Class SubjectDAO
java.lang.Object
fr.paris.lutece.plugins.helpdesk.business.SubjectDAO
- All Implemented Interfaces:
IAbstractSubjectDAO,ISubjectDAO
This class provides Data Access methods for Subject objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcountQuestion(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) return the count of all announce for Fieldvoiddelete(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete a record from the tablevoiddeleteAllLinksToFaq(int nIdAbstractSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) delete a record in the table.voiddeleteLinkToFaq(int nIdAbstractSubject, int nIdFaq, fr.paris.lutece.portal.service.plugin.Plugin plugin) delete a record in the table.List<? extends AbstractSubject>findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) Finds all objects of this typefindByFaqOrder(int nIdFaq, int nOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find a subject with the faq id and the order.Collection<? extends AbstractSubject>findByIdFaq(int nIdFaq, fr.paris.lutece.portal.service.plugin.Plugin plugin) Finds allSubjectspecified by the Faq idCollection<? extends AbstractSubject>findByIdParent(int nIdParent, fr.paris.lutece.portal.service.plugin.Plugin plugin) Finds allSubjectspecified by the parent idfindByOrder(int nIdParent, int nOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find a subject with the parent id and the order.findQuestions(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns all questions on a subjectfr.paris.lutece.util.ReferenceListfindSubject(fr.paris.lutece.portal.service.plugin.Plugin plugin) Finds all objects of this typeintgetMaxOrder(int nIdParent, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the max order of a parent subjectvoidinsert(AbstractSubject abstractSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new record in the table.voidinsertLinkToFaq(int nIdAbstractSubject, int nIdFaq, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new record in the table.load(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) load the data of Subject from the tableintnewPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin) Calculate a new primary key to add a new Subjectvoidstore(AbstractSubject abstractSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the record in the table
-
Constructor Details
-
SubjectDAO
public SubjectDAO()
-
-
Method Details
-
newPrimaryKey
public int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin) Calculate a new primary key to add a new Subject- Specified by:
newPrimaryKeyin interfaceIAbstractSubjectDAO- Parameters:
plugin- The Plugin using this data access service- Returns:
- The new key.
-
insert
public void insert(AbstractSubject abstractSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new record in the table.- Specified by:
insertin interfaceIAbstractSubjectDAO- Parameters:
abstractSubject- The Instance of the object Subjectplugin- The Plugin using this data access service
-
delete
public void delete(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete a record from the table- Specified by:
deletein interfaceIAbstractSubjectDAO- Parameters:
nIdSubject- The indentifier of the object Subjectplugin- The Plugin using this data access service
-
load
load the data of Subject from the table- Specified by:
loadin interfaceIAbstractSubjectDAO- Parameters:
nIdSubject- The indentifier of the object Subjectplugin- The Plugin using this data access service- Returns:
- The Instance of the object Subject
-
store
public void store(AbstractSubject abstractSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the record in the table- Specified by:
storein interfaceIAbstractSubjectDAO- Parameters:
abstractSubject- The instance of the Subject to updateplugin- The Plugin using this data access service
-
findAll
Finds all objects of this type- Specified by:
findAllin interfaceIAbstractSubjectDAO- Parameters:
plugin- The Plugin using this data access service- Returns:
- A collection of objects
-
findSubject
public fr.paris.lutece.util.ReferenceList findSubject(fr.paris.lutece.portal.service.plugin.Plugin plugin) Finds all objects of this type- Parameters:
plugin- The Plugin using this data access service- Returns:
- A collection of objects
-
findByIdParent
public Collection<? extends AbstractSubject> findByIdParent(int nIdParent, fr.paris.lutece.portal.service.plugin.Plugin plugin) Finds allSubjectspecified by the parent id- Specified by:
findByIdParentin interfaceIAbstractSubjectDAO- Parameters:
nIdParent- The parent subject idplugin- The Plugin using this data access service- Returns:
- A collection of
Subject
-
findByIdFaq
public Collection<? extends AbstractSubject> findByIdFaq(int nIdFaq, fr.paris.lutece.portal.service.plugin.Plugin plugin) Finds allSubjectspecified by the Faq id- Specified by:
findByIdFaqin interfaceIAbstractSubjectDAO- Parameters:
nIdFaq- The faq subject idplugin- The Plugin using this data access service- Returns:
- A collection of
Subject
-
findQuestions
public List<QuestionAnswer> findQuestions(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns all questions on a subject- Specified by:
findQuestionsin interfaceISubjectDAO- Parameters:
nIdSubject- The identifier of the subjectplugin- The Plugin using this data access service- Returns:
- A collection of questions
-
countQuestion
public int countQuestion(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) return the count of all announce for Field- Specified by:
countQuestionin interfaceISubjectDAO- Parameters:
plugin- The current plugin using this methodnIdSubject- The subject ID- Returns:
- count of announce for Field
-
getMaxOrder
public int getMaxOrder(int nIdParent, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the max order of a parent subject- Specified by:
getMaxOrderin interfaceIAbstractSubjectDAO- Parameters:
nIdParent- The id of the parent subjectplugin- ThePlugin- Returns:
- the max order
-
findByOrder
public Subject findByOrder(int nIdParent, int nOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find a subject with the parent id and the order.- Specified by:
findByOrderin interfaceIAbstractSubjectDAO- Parameters:
nIdParent- The parent IdnOrder- The orderplugin- ThePlugin- Returns:
- the
Subject
-
findByFaqOrder
public Subject findByFaqOrder(int nIdFaq, int nOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find a subject with the faq id and the order.- Specified by:
findByFaqOrderin interfaceIAbstractSubjectDAO- Parameters:
nIdFaq- The faq IdnOrder- The orderplugin- ThePlugin- Returns:
- the
Subject
-
insertLinkToFaq
public void insertLinkToFaq(int nIdAbstractSubject, int nIdFaq, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new record in the table.- Specified by:
insertLinkToFaqin interfaceIAbstractSubjectDAO- Parameters:
nIdAbstractSubject- The id of the object SubjectnIdFaq- The parent id of the object Faqplugin- The Plugin using this data access service
-
deleteLinkToFaq
public void deleteLinkToFaq(int nIdAbstractSubject, int nIdFaq, fr.paris.lutece.portal.service.plugin.Plugin plugin) delete a record in the table.- Specified by:
deleteLinkToFaqin interfaceIAbstractSubjectDAO- Parameters:
nIdAbstractSubject- The id of the object SubjectnIdFaq- The parent id of the object Faqplugin- The Plugin using this data access service
-
deleteAllLinksToFaq
public void deleteAllLinksToFaq(int nIdAbstractSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) delete a record in the table.- Specified by:
deleteAllLinksToFaqin interfaceIAbstractSubjectDAO- Parameters:
nIdAbstractSubject- The id of the object Subjectplugin- The Plugin using this data access service
-