Class CategoryDao


  • public class CategoryDao
    extends AbstractDao
    Provides a DAO for the Category entity.
    Since:
    3.6.0
    • Constructor Detail

      • CategoryDao

        public CategoryDao()
    • Method Detail

      • getCategoryForPK

        public Category getCategoryForPK​(Object categoryId)
        Return the category with the specified ID
        Parameters:
        categoryId - the OID of the category (required)
        Returns:
        the matching category, or null if not found
      • getCategoryByName

        public Category getCategoryByName​(Client client,
                                          String name)
        Return the category with the given name, for the given client. There should never be more than 1 match.
        Parameters:
        client - the client (required)
        name - the name (required)
        Returns:
        the matching category, or null if not found
      • getCategoriesForClient

        public List<Category> getCategoriesForClient​(Client client)
        Return the list of categories for the given client, ordered ascending by category name.
        Parameters:
        client - the client (required)
        Returns:
        the sorted list of categories
      • getCombinedCategoriesForPortal

        public List<String> getCombinedCategoriesForPortal​(Portal portal)
        Return the list of categories applicable to the given portals ordered by name (the set of category names belonging to clients associated with the portal) Note that since categories are client-specific, duplicate entries might exist and will be combined in the results.
        Parameters:
        portal - the portal (required)
        Returns:
        the list of categories, ordered by name
        Since:
        3.6.0