I get a nullpointer when using the inet-type on postgres 10/jdbc-4.2.1.4
Caused by: java.lang.NullPointerException
at org.postgresql.jdbc.TypeInfoCache.getOidStatement(TypeInfoCache.java:256)
Updating the method nullSafeSet to:
@Override
public void nullSafeSet(PreparedStatement preparedStatement, Object o, int i, SessionImplementor sessionImplementor) throws HibernateException, SQLException {
if (o == null) {
preparedStatement.setNull(i, java.sql.Types.OTHER);
} else {
PGobject object = new PGobject();
object.setValue(((InetAddress) o).getHostAddress());
**object.setType("inet");**
preparedStatement.setObject(i, object);
}
}
I get a nullpointer when using the inet-type on postgres 10/jdbc-4.2.1.4 Caused by: java.lang.NullPointerException at org.postgresql.jdbc.TypeInfoCache.getOidStatement(TypeInfoCache.java:256)
Updating the method nullSafeSet to:
Fixes the problem