64656667686970
@Override public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { String name = rs.getString(names[0]); return rs.wasNull() ? null : new CPF(name); }
2930313233343536373839
@Test public void shouldSaveAndLoadEntityMappedWithCpfUserType(){ Session session = factory.openSession(); Transaction transaction = session.beginTransaction(); PessoaFisica pessoa = new PessoaFisica(); CPF cpf = new CPF("555.555.555-55"); pessoa.setCpf(cpf); session.save(pessoa); transaction.commit(); session.flush(); session.close();
47484950515253
} public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner) throws HibernateException, SQLException { String name = resultSet.getString(names[0]); return resultSet.wasNull() ? null : new CPF(name); }