PGbox pgBox = new PGbox(); pgBox.setByteValue((byte[]) paramValues[index], 0); return "'" + pgBox.toString() + "'::box";
return new PGbox(rawValue.asString()); } catch (final SQLException e) { LOGGER.error("Failed to parse point {}, {}", rawValue.asString(), e);
@Override protected PGbox newInstance() { return new PGbox(); }
@Override protected Box toObjectFromString(String value) { String val=(String)value; try { PGbox pgObject=new PGbox(val); return toObject(pgObject); } catch(SQLException e) { throw new RuntimeException(e); } }
@Override public void nullSafeSet(PreparedStatement preparedStatement, Object value, int i, SharedSessionContractImplementor sessionImplementor) throws HibernateException, SQLException { Box rect = (Box) value; if (value == null) { preparedStatement.setNull(i, java.sql.Types.OTHER); } else { preparedStatement.setObject(i, new PGbox(rect.getP1().getX(), rect.getP1().getY(), rect.getP2().getX(), rect.getP2().getY())); } }
@Override protected PGbox toDbType(Box obj) { return new PGbox(obj.getPoints()[0].getX() , obj.getPoints()[0].getY() , obj.getPoints()[1].getX() , obj.getPoints()[1].getY() ); }
return new PGbox(rawValue.asString()); } catch (final SQLException e) { LOGGER.error("Failed to parse point {}, {}", rawValue.asString(), e);