@Test public void to_client_id_null() { Session session = mockSession(); Logger logger = mockLogger(); replay(); SampleEntity entity = new SampleEntity(); HibernateEntityValueEncoder<SampleEntity> encoder = new HibernateEntityValueEncoder<SampleEntity>( SampleEntity.class, "id", session, access, typeCoercer, logger); assertNull(encoder.toClient(entity)); verify(); }
@Override public String toClient(E value) { if (value == null) return null; Object id = propertyAdapter.get(value); if (id == null) { return null; } return typeCoercer.coerce(id, String.class); }
HibernateEntityValueEncoder implements ValueEncoder<E> { @Override public String toClient(E value) { if (value == null) return null; Object id = propertyAdapter.get(value); if (id == null) { return null; } return typeCoercer.coerce(id, String.class); } }
HibernateEntityValueEncoder implements ValueEncoder<E> { @Override public String toClient(E value) { if (value == null) return null; Object id = propertyAdapter.get(value); if (id == null) { return null; } return typeCoercer.coerce(id, String.class); } HibernateEntityValueEncoder(Class<E> entityClass, String identifierPropertyName, Session session,
                                       PropertyAccess propertyAccess, TypeCoercer typeCoercer, Logger logger); }
HibernateEntityValueEncoder implements ValueEncoder<E> { @Override public String toClient(E value) { if (value == null) return null; Object id = propertyAdapter.get(value); if (id == null) { return null; } return typeCoercer.coerce(id, String.class); } HibernateEntityValueEncoder(Class<E> entityClass, String identifierPropertyName, Session session,
                                       PropertyAccess propertyAccess, TypeCoercer typeCoercer, Logger logger); @Override String toClient(E value); @Override @SuppressWarnings("unchecked") E toValue(String clientValue); }
HibernateEntityValueEncoder implements ValueEncoder<E> { @Override public String toClient(E value) { if (value == null) return null; Object id = propertyAdapter.get(value); if (id == null) { return null; } return typeCoercer.coerce(id, String.class); } HibernateEntityValueEncoder(Class<E> entityClass, String identifierPropertyName, Session session,
                                       PropertyAccess propertyAccess, TypeCoercer typeCoercer, Logger logger); @Override String toClient(E value); @Override @SuppressWarnings("unchecked") E toValue(String clientValue);  }