Class EntityHydration


  • @Component
    public class EntityHydration
    extends Object
    Hydrates and dehydrates entities.
    • Constructor Detail

      • EntityHydration

        public EntityHydration​(org.molgenis.data.EntityManager entityManager)
    • Method Detail

      • hydrate

        public org.molgenis.data.Entity hydrate​(Map<String,​Object> dehydratedEntity,
                                                org.molgenis.data.meta.model.EntityType entityType)
        Rehydrate an entity. Entity can be an EntityWithComputedAttributes if there are attributes present with an expression
        Parameters:
        entityType - metadata of the entity to rehydrate
        dehydratedEntity - map with key value pairs representing this entity
        Returns:
        hydrated entity
      • dehydrate

        public Map<String,​Object> dehydrate​(org.molgenis.data.Entity entity)
        Creates a Map containing the values required to rebuild this entity. For references to other entities only stores the ids.
        Parameters:
        entity - the Entity to dehydrate
        Returns:
        Map representation of the entity