Class CategoryDAO
- java.lang.Object
-
- fr.paris.lutece.plugins.document.business.category.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 voiddelete(int nIdCategory)Delete a record from the tablevoiddeleteLinkCategoryDocument(int nIdCategory, int nIdDocument)Delete a link between category and documentvoiddeleteLinksCategory(int nIdCategory)Delete all links for a categoryvoidinsert(Category category)Insert a new CategoryCategoryload(int nIdCategory)Load the data of Category from the tablefr.paris.lutece.portal.service.image.ImageResourceloadImageResource(int nCategoryId)Return the image resource corresponding to the category idjava.util.Collection<Category>selectAll()Load the list of Categoryint[]selectAllIdDocument(int nIdCategory)Select a list of Id Documents for a specified categoryjava.util.Collection<Category>selectByName(java.lang.String strCategoryName)Load the data of Category from the tableintselectCountIdDocuments(int nIdCategory)Return the number of documents linked to a categoryvoidstore(Category category)Update the record in the table
-
-
-
Method Detail
-
selectAll
public java.util.Collection<Category> selectAll()
Load the list of Category- Specified by:
selectAllin interfaceICategoryDAO- Returns:
- The Collection of Category (empty collection is no result)
-
insert
public void insert(Category category)
Insert a new Category- Specified by:
insertin interfaceICategoryDAO- Parameters:
category- The object category to insert
-
load
public Category load(int nIdCategory)
Load the data of Category from the table- Specified by:
loadin interfaceICategoryDAO- 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:
deletein interfaceICategoryDAO- Parameters:
nIdCategory- The identifier of the object Category
-
store
public void store(Category category)
Update the record in the table- Specified by:
storein interfaceICategoryDAO- 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:
selectByNamein interfaceICategoryDAO- 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 CategorynIdDocument- 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:
selectCountIdDocumentsin interfaceICategoryDAO- 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:
loadImageResourcein interfaceICategoryDAO- Parameters:
nCategoryId- The identifier of Category object- Returns:
- The image resource
-
-