@Test public void should_persist_and_find_all_types() throws Exception {
  Long id=RandomUtils.nextLong();
  byte[] bytes="toto".getBytes(Charsets.UTF_8);
  Date now=new Date();
  InetAddress inetAddress=InetAddresses.forString("192.168.0.1");
  EntityWithAllTypes entity=new EntityWithAllTypes();
  entity.setId(id);
  entity.setPrimitiveByte((byte)7);
  entity.setObjectByte((byte)7);
  entity.setByteArray(bytes);
  entity.setByteBuffer(ByteBuffer.wrap(bytes));
  entity.setPrimitiveBool(true);
  entity.setObjectBool(true);
  entity.setDate(now);
  entity.setPrimitiveDouble(1.0d);
  entity.setObjectDouble(1.0d);
  entity.setBigDecimal(new BigDecimal(1.11));
  entity.setPrimitiveFloat(1.0f);
  entity.setObjectFloat(1.0f);
  entity.setInetAddress(inetAddress);
  entity.setBigInt(new BigInteger("10"));
  entity.setPrimitiveInt(10);
  entity.setObjectInt(10);
  entity.setPrimitiveLong(10L);
  manager.persist(entity);
  EntityWithAllTypes found=manager.find(EntityWithAllTypes.class,id);
  assertThat(found.getPrimitiveByte()).isEqualTo((byte)7);
  assertThat(found.getObjectByte()).isEqualTo((byte)7);
  assertThat(found.getByteArray()).isEqualTo(bytes);
  assertThat(found.getByteBuffer()).isEqualTo(ByteBuffer.wrap(bytes));
  assertThat(found.isPrimitiveBool()).isTrue();
  assertThat(found.getObjectBool()).isTrue();
  assertThat(found.getDate()).isEqualTo(now);
  assertThat(found.getPrimitiveDouble()).isEqualTo(1.0d);
  assertThat(found.getObjectDouble()).isEqualTo(1.0d);
  assertThat(found.getBigDecimal()).isEqualTo(new BigDecimal(1.11));
  assertThat(found.getPrimitiveFloat()).isEqualTo(1.0f);
  assertThat(found.getObjectFloat()).isEqualTo(1.0f);
  assertThat(found.getInetAddress()).isEqualTo(inetAddress);
  assertThat(found.getBigInt()).isEqualTo(new BigInteger("10"));
  assertThat(found.getPrimitiveInt()).isEqualTo(10);
  assertThat(found.getObjectInt()).isEqualTo(10);
  assertThat(found.getPrimitiveLong()).isEqualTo(10L);
}
