Class QuestionAnswerDAO
java.lang.Object
fr.paris.lutece.plugins.helpdesk.business.QuestionAnswerDAO
- All Implemented Interfaces:
IQuestionAnswerDAO
This class provides Data Access methods for QuestionAnswerAnswer objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcountbySubject(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) voiddelete(int nIdQuestionAnswer, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete a record from the tablevoiddeleteAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete all records from the tablevoiddeleteBySubject(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete a record from the tablefindAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) Find all objects.findByIdSubject(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find questions specified by id subjectfindByKeywords(String strKeywords, fr.paris.lutece.portal.service.plugin.Plugin plugin) load the data of QuestionAnswer from the tableintgetMaxOrder(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the max order of a given subjectvoidinsert(QuestionAnswer questionAnswer, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new record in the table.load(int nIdQuestionAnswer, fr.paris.lutece.portal.service.plugin.Plugin plugin) load the data of QuestionAnswer from the tableintnewPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin) Calculate a new primary key to add a new QuestionAnswervoidstore(QuestionAnswer questionAnswer, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the record in the table
-
Constructor Details
-
QuestionAnswerDAO
public QuestionAnswerDAO()
-
-
Method Details
-
newPrimaryKey
public int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin) Calculate a new primary key to add a new QuestionAnswer- Specified by:
newPrimaryKeyin interfaceIQuestionAnswerDAO- Parameters:
plugin- The Plugin using this data access service- Returns:
- The new key.
-
insert
public void insert(QuestionAnswer questionAnswer, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new record in the table.- Specified by:
insertin interfaceIQuestionAnswerDAO- Parameters:
questionAnswer- The Instance of the object QuestionAnswerplugin- The Plugin using this data access service
-
delete
public void delete(int nIdQuestionAnswer, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete a record from the table- Specified by:
deletein interfaceIQuestionAnswerDAO- Parameters:
nIdQuestionAnswer- The indentifier of the object QuestionAnswerplugin- The Plugin using this data access service
-
deleteAll
public void deleteAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete all records from the table- Specified by:
deleteAllin interfaceIQuestionAnswerDAO- Parameters:
plugin- The Plugin using this data access service
-
deleteBySubject
public void deleteBySubject(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete a record from the table- Specified by:
deleteBySubjectin interfaceIQuestionAnswerDAO- Parameters:
nIdSubject- The indentifier of the object QuestionAnswerplugin- The Plugin using this data access service
-
load
public QuestionAnswer load(int nIdQuestionAnswer, fr.paris.lutece.portal.service.plugin.Plugin plugin) load the data of QuestionAnswer from the table- Specified by:
loadin interfaceIQuestionAnswerDAO- Parameters:
nIdQuestionAnswer- The indentifier of the object QuestionAnswerplugin- The Plugin using this data access service- Returns:
- The Instance of the object QuestionAnswer
-
store
public void store(QuestionAnswer questionAnswer, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the record in the table- Specified by:
storein interfaceIQuestionAnswerDAO- Parameters:
questionAnswer- The instance of the QuestionAnswer to updateplugin- The Plugin using this data access service
-
findAll
Find all objects.- Specified by:
findAllin interfaceIQuestionAnswerDAO- Parameters:
plugin- The Plugin using this data access service- Returns:
- A Collection of objects
-
findByKeywords
public List<QuestionAnswer> findByKeywords(String strKeywords, fr.paris.lutece.portal.service.plugin.Plugin plugin) load the data of QuestionAnswer from the table- Specified by:
findByKeywordsin interfaceIQuestionAnswerDAO- Parameters:
strKeywords- The keywords which are searched in question/answerplugin- The Plugin using this data access service- Returns:
- The collection of QuestionAnswer object
-
findByIdSubject
public Collection<QuestionAnswer> findByIdSubject(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find questions specified by id subject- Specified by:
findByIdSubjectin interfaceIQuestionAnswerDAO- Parameters:
nIdSubject- The Id of the subjectplugin- The current plugin using this method- Returns:
- A Collection containing the results
-
countbySubject
public int countbySubject(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) - Specified by:
countbySubjectin interfaceIQuestionAnswerDAO- Parameters:
plugin- The Plugin using this data access servicenIdSubject- The Subject ID- Returns:
- count
-
getMaxOrder
public int getMaxOrder(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the max order of a given subject- Specified by:
getMaxOrderin interfaceIQuestionAnswerDAO- Parameters:
nIdSubject- The id of the Subjectplugin- ThePlugin- Returns:
- the max order
-