@Test void dehydrateTest() { Map<String, Object> actualDehydratedEntity = entityHydration.dehydrate(hydratedEntity); assertEquals(dehydratedEntity, actualDehydratedEntity); }
public Map<String, Object> dehydrate(Entity entity) { LOG.trace("Dehydrating entity {}", entity); Map<String, Object> dehydratedEntity = newHashMap(); EntityType entityType = entity.getEntityType(); entityType .getAtomicAttributes() .forEach( attribute -> { if (!attribute.hasExpression()) { String name = attribute.getName(); AttributeType type = attribute.getDataType(); dehydratedEntity.put(name, getValueBasedOnType(entity, name, type)); } }); return dehydratedEntity; }
EntityHydration { public Map<String, Object> dehydrate(Entity entity) { LOG.trace("Dehydrating entity {}", entity); Map<String, Object> dehydratedEntity = newHashMap(); EntityType entityType = entity.getEntityType(); entityType .getAtomicAttributes() .forEach( attribute -> { if (!attribute.hasExpression()) { String name = attribute.getName(); AttributeType type = attribute.getDataType(); dehydratedEntity.put(name, getValueBasedOnType(entity, name, type)); } }); return dehydratedEntity; } }
EntityHydration { public Map<String, Object> dehydrate(Entity entity) { LOG.trace("Dehydrating entity {}", entity); Map<String, Object> dehydratedEntity = newHashMap(); EntityType entityType = entity.getEntityType(); entityType .getAtomicAttributes() .forEach( attribute -> { if (!attribute.hasExpression()) { String name = attribute.getName(); AttributeType type = attribute.getDataType(); dehydratedEntity.put(name, getValueBasedOnType(entity, name, type)); } }); return dehydratedEntity; } EntityHydration(EntityManager entityManager); }
EntityHydration { public Map<String, Object> dehydrate(Entity entity) { LOG.trace("Dehydrating entity {}", entity); Map<String, Object> dehydratedEntity = newHashMap(); EntityType entityType = entity.getEntityType(); entityType .getAtomicAttributes() .forEach( attribute -> { if (!attribute.hasExpression()) { String name = attribute.getName(); AttributeType type = attribute.getDataType(); dehydratedEntity.put(name, getValueBasedOnType(entity, name, type)); } }); return dehydratedEntity; } EntityHydration(EntityManager entityManager); Entity hydrate(Map<String, Object> dehydratedEntity, EntityType entityType); Entity hydrate(
      Map<String, Object> dehydratedEntity,
      EntityType entityType,
      @Nullable @CheckForNull Fetch fetch); Map<String, Object> dehydrate(Entity entity); }
EntityHydration { public Map<String, Object> dehydrate(Entity entity) { LOG.trace("Dehydrating entity {}", entity); Map<String, Object> dehydratedEntity = newHashMap(); EntityType entityType = entity.getEntityType(); entityType .getAtomicAttributes() .forEach( attribute -> { if (!attribute.hasExpression()) { String name = attribute.getName(); AttributeType type = attribute.getDataType(); dehydratedEntity.put(name, getValueBasedOnType(entity, name, type)); } }); return dehydratedEntity; } EntityHydration(EntityManager entityManager); Entity hydrate(Map<String, Object> dehydratedEntity, EntityType entityType); Entity hydrate(
      Map<String, Object> dehydratedEntity,
      EntityType entityType,
      @Nullable @CheckForNull Fetch fetch); Map<String, Object> dehydrate(Entity entity);  }