}
public void nullSafeSet(PreparedStatement st, Object value, int index)
throws HibernateException, SQLException {
BoundingBox box = (BoundingBox) value;
if (box == null) {
//set to null
st.setDouble(index, 1);
st.setDouble(index + 1, 1);
st.setDouble(index + 2, -1);
st.setDouble(index + 3, -1);
st.setNull(index + 4, Types.VARCHAR);
//st.setBlob(index + 4, (Blob) null);
return;
}
//TODO: check for isNull() and set the minx,maxx accordingly
st.setDouble(index, box.getMinX());
st.setDouble(index + 1, box.getMinY());
st.setDouble(index + 2, box.getMaxX());
st.setDouble(index + 3, box.getMaxY());
if (box.getCoordinateReferenceSystem() != null) {
CoordinateReferenceSystem crs = box.getCoordinateReferenceSystem();
if (storeCRSAsWKT) {
st.setString(index+4, crs.toWKT());
}
else {
try {