Interface PersistenceContextEntityManager

    • Method Detail

      • find

        Object find​(WmId primaryKey,
                    PersistenceContext persistenceContext)
        Looks up an entity by its id
        Parameters:
        primaryKey - the id identifying the entity to load
        persistenceContext -
        Returns:
        the requested entity or null if it wasn't found
      • persist

        <T> T persist​(T entity,
                      PersistenceContext persistenceContext)
        Persists an entity which is not yet persisted (i.e. which doesn't have its' WmId filled in yet)
        Type Parameters:
        T - The type of the entity to persist
        Parameters:
        entity - The entity to persist
        persistenceContext -
        Returns:
        The persisted entity with its WmId filled in.
      • delete

        <T> void delete​(T entity,
                        PersistenceContext persistenceContext)
                 throws DomainException
        Deletes an entity from the persistence backend
        Type Parameters:
        T - The type of the entity to delete
        Parameters:
        entity - The entity to be deleted
        persistenceContext -
        Throws:
        DomainException - when something went wrong while deleting the entity
      • save

        <T> T save​(T entity,
                   PersistenceContext persistenceContext)
            throws DomainException
        Saves an entity that was persisted before (i.e. which does have its' WmId filled in)
        Type Parameters:
        T - The type of the entity to persist
        Parameters:
        entity - The entity to persist
        persistenceContext -
        Returns:
        The entity
        Throws:
        DomainException - when something went wrong while saving the entity
      • registerEntityDomainClass

        void registerEntityDomainClass​(EntityDomain entityDomain,
                                       String classname)
        Meant to be called from EntityDomain in order to create a mapping from classnames to EntityDomains.
        Parameters:
        entityDomain - the EntityDomain which can handle entities of the specified class
        classname - the name of a Class the EntityDomain can handle
      • unregisterEntityDomainClass

        void unregisterEntityDomainClass​(String classname)
        Meant to be called from EntityDomain in order to update the mapping from classnames to EntityDomains.
        Parameters:
        classname - the classname to unregister