Class EntityHydration


  • @Component
    public class EntityHydration
    extends java.lang.Object
    Hydrates and dehydrates entities.
    • Constructor Summary

      Constructors 
      Constructor Description
      EntityHydration​(org.molgenis.data.EntityManager entityManager)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> dehydrate​(org.molgenis.data.Entity entity)
      Creates a Map containing the values required to rebuild this entity.
      org.molgenis.data.Entity hydrate​(java.util.Map<java.lang.String,​java.lang.Object> dehydratedEntity, org.molgenis.data.meta.model.EntityType entityType)
      Rehydrate an entity.
      org.molgenis.data.Entity hydrate​(java.util.Map<java.lang.String,​java.lang.Object> dehydratedEntity, org.molgenis.data.meta.model.EntityType entityType, org.molgenis.data.Fetch fetch)
      Rehydrate a partial entity.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EntityHydration

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

      • hydrate

        public org.molgenis.data.Entity hydrate​(java.util.Map<java.lang.String,​java.lang.Object> dehydratedEntity,
                                                org.molgenis.data.meta.model.EntityType entityType)
        Rehydrate an entity.
        Parameters:
        entityType - metadata of the entity to rehydrate
        dehydratedEntity - map with key value pairs representing this entity
        Returns:
        hydrated entity
      • hydrate

        public org.molgenis.data.Entity hydrate​(java.util.Map<java.lang.String,​java.lang.Object> dehydratedEntity,
                                                org.molgenis.data.meta.model.EntityType entityType,
                                                org.molgenis.data.Fetch fetch)
        Rehydrate a partial entity.
        Parameters:
        entityType - metadata of the entity to rehydrate
        dehydratedEntity - map with key value pairs representing this entity
        fetch - containing attributes to retrieve, can be null
        Returns:
        hydrated entity
      • dehydrate

        public java.util.Map<java.lang.String,​java.lang.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