Class CategoryHome


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void create​(Category category)
      Create a new Category
      static Category find​(int nIdCategory)
      Find the data of Category from the table
      static java.util.Collection<Category> findAll()
      Returns the category list
      static java.util.Collection<Category> findByName​(java.lang.String strCategoryName)
      Find the data of Category from the table
      static int findCountIdDocuments​(int nIdCategory)
      Find the number of documents linked to a category
      static fr.paris.lutece.portal.service.image.ImageResource getImageResource​(int nCategoryId)
      Return the image resource for the specified category id
      static void remove​(int nIdCategory)
      Remove a record from the table
      static void update​(Category category)
      Update the record in the table
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • findAll

        public static java.util.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 java.util.Collection<Category> findByName​(java.lang.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