@Test public void setStoresNullForOtherValues() throws HibernateException, SQLException { this.type.nullSafeSet(this.st, "reference", 0); Mockito.verify(this.st).setNull(0, Types.VARCHAR); }
@Override public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { if (User.class.isInstance(value)) { st.setString(index, ((User) value).getId()); } else { st.setNull(index, Types.VARCHAR); } }
UserType implements org.hibernate.usertype.UserType { @Override public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { if (User.class.isInstance(value)) { st.setString(index, ((User) value).getId()); } else { st.setNull(index, Types.VARCHAR); } } }
UserType implements org.hibernate.usertype.UserType { @Override public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { if (User.class.isInstance(value)) { st.setString(index, ((User) value).getId()); } else { st.setNull(index, Types.VARCHAR); } }  }
UserType implements org.hibernate.usertype.UserType { @Override public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { if (User.class.isInstance(value)) { st.setString(index, ((User) value).getId()); } else { st.setNull(index, Types.VARCHAR); } }  @Override int[] sqlTypes(); @Override Class<?> returnedClass(); @Override boolean equals(Object x, Object y); @Override int hashCode(Object x); @Override Object nullSafeGet(ResultSet rs, String[] names, Object owner); @Override void nullSafeSet(PreparedStatement st, Object value, int index); @Override Object deepCopy(Object value); @Override boolean isMutable(); @Override Serializable disassemble(Object value); @Override Object assemble(Serializable cached, Object owner); @Override Object replace(Object original, Object target, Object owner); }
UserType implements org.hibernate.usertype.UserType { @Override public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { if (User.class.isInstance(value)) { st.setString(index, ((User) value).getId()); } else { st.setNull(index, Types.VARCHAR); } }  @Override int[] sqlTypes(); @Override Class<?> returnedClass(); @Override boolean equals(Object x, Object y); @Override int hashCode(Object x); @Override Object nullSafeGet(ResultSet rs, String[] names, Object owner); @Override void nullSafeSet(PreparedStatement st, Object value, int index); @Override Object deepCopy(Object value); @Override boolean isMutable(); @Override Serializable disassemble(Object value); @Override Object assemble(Serializable cached, Object owner); @Override Object replace(Object original, Object target, Object owner);  }