Package br.com.caelum.stella.tinytype

Examples of br.com.caelum.stella.tinytype.CPF


  @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);
  }
View Full Code Here


  @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();
View Full Code Here

  }

  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);
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.stella.tinytype.CPF

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.