Class PostfachDao

All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<Postfach,Long,IEntityContext>, IGenericDao<Postfach>, IMandantDependentBaseDao<Postfach>, IPostfachDao

public class PostfachDao extends MandantDependentBaseDao<Postfach> implements IPostfachDao
The default implementation of IPostfachDao that can be accessed via DaoProvider.
Author:
XIMA MEDIA GmbH
  • Constructor Details

    • PostfachDao

      public PostfachDao()
      Creates a new instance of this DAO. Normally you should use the singleton instance provided by DaoProvider.POSTFACH_DAO.
  • Method Details

    • getEntityRefs

      public Set<de.xima.cmn.dao.interfaces.IEntity<Long>> getEntityRefs(IEntityContext ec, Postfach inbox)
      Description copied from interface: IGenericDao
      Returns a set of entities that reference the given entity and depend on it. An entity can usually not be deleted if it is still being referenced by and depended on by other entities.
      Specified by:
      getEntityRefs in interface IGenericDao<Postfach>
      Overrides:
      getEntityRefs in class GenericDao<Postfach>
      Parameters:
      ec - entity context for database transactions.
      inbox - to get references for.
      Returns:
      a set of entities that reference the given entity and depend on it.
    • clear

      public void clear(IEntityContext ec, Postfach postfach)
      Description copied from interface: IPostfachDao
      Deletes all form records in the given inbox.
      Specified by:
      clear in interface IPostfachDao
      Parameters:
      ec - Entity context to use for interacting with the database.
      postfach - Inbox to clear.
    • clear

      @Deprecated public void clear(IEntityContext ec, Mandant man, Postfach postfach)
      Description copied from interface: IPostfachDao
      Deletes all form records in the given inbox.
      Specified by:
      clear in interface IPostfachDao
      Parameters:
      ec - Entity context to use for interacting with the database.
      man - Client to which the inbox belongs.
      postfach - Inbox to clear.
    • getPostfachByBenutzer

      @Deprecated public List<Postfach> getPostfachByBenutzer(IEntityContext ec, Benutzer benutzer)
      Deprecated.
      Specified by:
      getPostfachByBenutzer in interface IPostfachDao
      Parameters:
      ec - Entity context to use for interacting with the database.
      benutzer - User for which to find inboxes.
      Returns:
      A list of all inboxes accessible to the given user.
    • getPreActionHook

      protected IFCDaoActionHook<Postfach> getPreActionHook()
      Overrides:
      getPreActionHook in class GenericDao<Postfach>
    • getPostActionHook

      protected IFCDaoActionHook<Postfach> getPostActionHook()
      Overrides:
      getPostActionHook in class GenericDao<Postfach>
    • getAllByUserGroups

      public List<Postfach> getAllByUserGroups(IEntityContext ec, Collection<? extends BenutzerGruppe> userGroups)
      Specified by:
      getAllByUserGroups in interface IPostfachDao
      Parameters:
      ec - Entity context to use for interacting with the database.
      userGroups - User groups to check.
      Returns:
      All inboxes with access to at least one of the given groups.
    • getAllNamesByUserGroups

      public Set<String> getAllNamesByUserGroups(IEntityContext ec, Collection<? extends BenutzerGruppe> userGroups)
      Specified by:
      getAllNamesByUserGroups in interface IPostfachDao
      Parameters:
      ec - Entity context to use for interacting with the database.
      userGroups - User groups to check.
      Returns:
      The names of all inboxes with access to at least one of the given user groups.
    • getAllByClient

      public List<Postfach> getAllByClient(IEntityContext ec, Mandant client)
      Description copied from interface: IPostfachDao
      Returns all inboxes of the given client.
      Specified by:
      getAllByClient in interface IPostfachDao
      Parameters:
      ec - Entity context to use for interacting with the database.
      client - Client context in which to look for inbox
      Returns:
      A list of inboxes of the given client
    • getByUUID

      public Postfach getByUUID(IEntityContext ec, Mandant client, String uuid)
      Description copied from interface: IPostfachDao
      Returns the inbox with the given UUID
      Specified by:
      getByUUID in interface IPostfachDao
      Parameters:
      ec - Entity context to use for interacting with the database.
      client - Client context in which to look for inbox
      uuid - UUID of the inbox
      Returns:
      The inbox with the given UUID and client, if such an inbox exists.
    • getByUUID

      public Postfach getByUUID(IEntityContext ec, Mandant client, UUID uuid)
      Description copied from interface: IPostfachDao
      Returns the inbox with the given UUID
      Specified by:
      getByUUID in interface IPostfachDao
      Parameters:
      ec - Entity context to use for interacting with the database.
      client - Client context in which to look for inbox
      uuid - UUID UUID of the inbox
      Returns:
      The inbox with the given UUID and client, if such an inbox exists.
    • findUniqueName

      public String findUniqueName(IEntityContext ec, Mandant client, String candidate, Postfach exclude)
      Description copied from interface: IPostfachDao
      Returns a name that is not taken by another Postfach in the given client other than the excluded inbox. An index will be added to the candidate if necessary.
      Specified by:
      findUniqueName in interface IPostfachDao
      Parameters:
      ec - Entity context to use for interacting with the database.
      client - Client for which a unique inbox name should be generated
      candidate - Inbox name candidate to be made unique
      exclude - Inbox to be excluded from search
      Returns:
      unique inbox name in the context of the given client
    • isNameExisiting

      public boolean isNameExisiting(IEntityContext ec, Mandant client, String name)
      Description copied from interface: IPostfachDao
      Returns whether or not the given inbox name exists within the given client
      Specified by:
      isNameExisiting in interface IPostfachDao
      Parameters:
      ec - Entity context to use for interacting with the database.
      client - Client context in which to look for inbox
      name - An inbox name to check
      Returns:
      whether or not the given name is unique