fr.paris.lutece.plugins.calendar.business.category
Class CategoryDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.calendar.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
CategoryDAO()
           
 
Method Summary
 void delete(int nIdCategory)
          Delete a record from the table
 void deleteLinkCategoryEvent(int nIdCategory, int nIdEvent)
          Delete a link between category and event
 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[] selectAllIdEvent(int nIdCategory)
          Select a list of Id Events for a specified category
 java.util.Collection<Category> selectByEvent(int nIdEvent)
          Load the data of Category for an event from the table
 java.util.Collection<Category> selectByName(java.lang.String strCategoryName)
          Load the data of Category from the table
 int selectCountIdEvents(int nIdCategory)
          Return the number of Events linked to a category
 void store(Category category)
          Update the record in the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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

selectByEvent

public java.util.Collection<Category> selectByEvent(int nIdEvent)
Load the data of Category for an event from the table

Specified by:
selectByEvent in interface ICategoryDAO
Parameters:
nIdEvent - The identifier of the event
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)

deleteLinkCategoryEvent

public void deleteLinkCategoryEvent(int nIdCategory,
                                    int nIdEvent)
Delete a link between category and event

Parameters:
nIdCategory - The identifier of the object Category
nIdEvent - The id of document

selectAllIdEvent

public int[] selectAllIdEvent(int nIdCategory)
Select a list of Id Events for a specified category

Parameters:
nIdCategory - The category name
Returns:
The array of Id Event

deleteLinksCategory

public void deleteLinksCategory(int nIdCategory)
Delete all links for a category

Parameters:
nIdCategory - The identifier of the object Category

selectCountIdEvents

public int selectCountIdEvents(int nIdCategory)
Return the number of Events linked to a category

Specified by:
selectCountIdEvents in interface ICategoryDAO
Parameters:
nIdCategory - The category name
Returns:
count of id event

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


Copyright © 2009 Mairie de Paris. All Rights Reserved.