java.lang.Object
fr.paris.lutece.plugins.document.business.category.CategoryDAO
All Implemented Interfaces:
ICategoryDAO

public final class CategoryDAO extends Object implements ICategoryDAO
This class provides Data Access methods for Category objects
  • Constructor Details

    • CategoryDAO

      public CategoryDAO()
  • Method Details

    • selectAll

      public 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 Collection<Category> selectByName(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