Class CategoryDAO

  • All Implemented Interfaces:
    ICategoryDAO

    public final class CategoryDAO
    extends java.lang.Object
    implements ICategoryDAO
    This class provides Data Access methods for Category objects
    • Constructor Summary

      Constructors 
      Constructor Description
      CategoryDAO()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete​(int nIdCategory)
      Delete a record from the table
      void deleteLinkCategoryDocument​(int nIdCategory, int nIdDocument)
      Delete a link between category and document
      void deleteLinksCategory​(int nIdCategory)
      Delete all links for a category
      void insert​(Category category)
      Insert a new Category
      Category load​(int nIdCategory)
      Load the data of Category from the table
      fr.paris.lutece.portal.service.image.ImageResource loadImageResource​(int nCategoryId)
      Return the image resource corresponding to the category id
      java.util.Collection<Category> selectAll()
      Load the list of Category
      int[] selectAllIdDocument​(int nIdCategory)
      Select a list of Id Documents for a specified category
      java.util.Collection<Category> selectByName​(java.lang.String strCategoryName)
      Load the data of Category from the table
      int selectCountIdDocuments​(int nIdCategory)
      Return the number of documents linked to a category
      void store​(Category category)
      Update the record in the table
      • Methods inherited from class java.lang.Object

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

      • CategoryDAO

        public CategoryDAO()
    • Method Detail

      • selectAll

        public java.util.Collection<Category> selectAll()
        Load the list of Category
        Specified by:
        selectAll in interface ICategoryDAO
        Returns:
        The Collection of Category (empty collection is no result)
      • insert

        public void insert​(Category category)
        Insert a new Category
        Specified by:
        insert in interface ICategoryDAO
        Parameters:
        category - The object category to insert
      • load

        public Category load​(int nIdCategory)
        Load the data of Category from the table
        Specified by:
        load in interface ICategoryDAO
        Parameters:
        nIdCategory - The identifier of the category
        Returns:
        The Instance of the object Category
      • delete

        public void delete​(int nIdCategory)
        Delete a record from the table
        Specified by:
        delete in interface ICategoryDAO
        Parameters:
        nIdCategory - The identifier of the object Category
      • store

        public void store​(Category category)
        Update the record in the table
        Specified by:
        store in interface ICategoryDAO
        Parameters:
        category - The instance of the Category to update
      • selectByName

        public java.util.Collection<Category> selectByName​(java.lang.String strCategoryName)
        Load the data of Category from the table
        Specified by:
        selectByName in interface ICategoryDAO
        Parameters:
        strCategoryName - The name of the category
        Returns:
        The Collection of Category (empty collection is no result)
      • deleteLinkCategoryDocument

        public void deleteLinkCategoryDocument​(int nIdCategory,
                                               int nIdDocument)
        Delete a link between category and document
        Parameters:
        nIdCategory - The identifier of the object Category
        nIdDocument - The id of document
      • selectAllIdDocument

        public int[] selectAllIdDocument​(int nIdCategory)
        Select a list of Id Documents for a specified category
        Parameters:
        nIdCategory - The category name
        Returns:
        The array of Id Document
      • deleteLinksCategory

        public void deleteLinksCategory​(int nIdCategory)
        Delete all links for a category
        Parameters:
        nIdCategory - The identifier of the object Category
      • selectCountIdDocuments

        public int selectCountIdDocuments​(int nIdCategory)
        Return the number of documents linked to a category
        Specified by:
        selectCountIdDocuments in interface ICategoryDAO
        Parameters:
        nIdCategory - The category name
        Returns:
        count of id document
      • loadImageResource

        public fr.paris.lutece.portal.service.image.ImageResource loadImageResource​(int nCategoryId)
        Return the image resource corresponding to the category id
        Specified by:
        loadImageResource in interface ICategoryDAO
        Parameters:
        nCategoryId - The identifier of Category object
        Returns:
        The image resource