Class CategoryHome


  • public final class CategoryHome
    extends Object
    This class provides instances management methods (create, find, ...) for Category objects
    • Method Detail

      • findAll

        public static Collection<Category> findAll()
        Returns the category list
        Returns:
        Collection of Category (empty collection is no result)
      • create

        public static void create​(Category category)
        Create a new Category
        Parameters:
        category - The new Category
      • find

        public static Category find​(int nIdCategory)
        Find the data of Category from the table
        Parameters:
        nIdCategory - The id of the category
        Returns:
        The Instance of the object Category of null if no category match
      • findByName

        public static Collection<Category> findByName​(String strCategoryName)
        Find the data of Category from the table
        Parameters:
        strCategoryName - The id of the category
        Returns:
        The Collection of Category (empty collection is no result)
      • remove

        public static void remove​(int nIdCategory)
        Remove a record from the table
        Parameters:
        nIdCategory - The identifier of the object Category
      • update

        public static void update​(Category category)
        Update the record in the table
        Parameters:
        category - The instance of the Category to update
      • findCountIdDocuments

        public static int findCountIdDocuments​(int nIdCategory)
        Find the number of documents linked to a category
        Parameters:
        nIdCategory - The category id
        Returns:
        count of id document
      • getImageResource

        public static fr.paris.lutece.portal.service.image.ImageResource getImageResource​(int nCategoryId)
        Return the image resource for the specified category id
        Parameters:
        nCategoryId - The identifier of Category object
        Returns:
        ImageResource