fr.paris.lutece.plugins.quiz.business
Class QuestionGroupDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.quiz.business.QuestionGroupDAO
All Implemented Interfaces:
IQuestionGroupDAO

public final class QuestionGroupDAO
extends java.lang.Object
implements IQuestionGroupDAO

This class provides Data Access methods for QuestionGroup objects


Constructor Summary
QuestionGroupDAO()
           
 
Method Summary
 void changePositionDown(int nIdQuiz, QuestionGroup group, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Move down a group
 void changePositionUp(int nIdQuiz, QuestionGroup group, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Move up a group
 void delete(int nIdQuiz, int nGroupId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete a record from the table
 void deleteByQuiz(int nIdQuiz, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete a record from the table
 void insert(int nIdQuiz, QuestionGroup group, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new record in the table.
 QuestionGroup load(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of the group from the table
 int newPositionGroup(int nIdQuiz, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          The position of the group
 int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Generates a new primary key
 java.util.List<QuestionGroup> selectQuestionGroupsList(int nIdQuiz, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of all the groups and returns them as a List
 fr.paris.lutece.util.ReferenceList selectQuestionGroupsReferenceList(int nIdQuiz, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Gets a group list
 void store(QuestionGroup group, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          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

QuestionGroupDAO

public QuestionGroupDAO()
Method Detail

newPrimaryKey

public int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Generates a new primary key

Parameters:
plugin - The Plugin
Returns:
The new primary key

newPositionGroup

public int newPositionGroup(int nIdQuiz,
                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
The position of the group

Parameters:
nIdQuiz - The quiz Id
plugin - The plugin
Returns:
The new position

insert

public void insert(int nIdQuiz,
                   QuestionGroup group,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new record in the table.

Specified by:
insert in interface IQuestionGroupDAO
Parameters:
nIdQuiz - The quiz Id
group - instance of the QuestionGroup object to insert
plugin - The plugin

load

public QuestionGroup load(int nId,
                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of the group from the table

Specified by:
load in interface IQuestionGroupDAO
Parameters:
nId - The identifier of the group
plugin - The plugin
Returns:
the instance of the QuestionGroup

delete

public void delete(int nIdQuiz,
                   int nGroupId,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete a record from the table

Specified by:
delete in interface IQuestionGroupDAO
Parameters:
nIdQuiz - The quiz Id
nGroupId - The identifier of the group
plugin - The plugin

store

public void store(QuestionGroup group,
                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the record in the table

Specified by:
store in interface IQuestionGroupDAO
Parameters:
group - The reference of the group
plugin - The plugin

selectQuestionGroupsList

public java.util.List<QuestionGroup> selectQuestionGroupsList(int nIdQuiz,
                                                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of all the groups and returns them as a List

Specified by:
selectQuestionGroupsList in interface IQuestionGroupDAO
Parameters:
nIdQuiz - The quiz Id
plugin - The plugin
Returns:
The List which contains the data of all the groups

selectQuestionGroupsReferenceList

public fr.paris.lutece.util.ReferenceList selectQuestionGroupsReferenceList(int nIdQuiz,
                                                                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Gets a group list

Specified by:
selectQuestionGroupsReferenceList in interface IQuestionGroupDAO
Parameters:
nIdQuiz - The quiz Id
plugin - The plugin
Returns:
The list

deleteByQuiz

public void deleteByQuiz(int nIdQuiz,
                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete a record from the table

Specified by:
deleteByQuiz in interface IQuestionGroupDAO
Parameters:
nIdQuiz - The identifier of the group
plugin - The plugin

changePositionUp

public void changePositionUp(int nIdQuiz,
                             QuestionGroup group,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Move up a group

Specified by:
changePositionUp in interface IQuestionGroupDAO
Parameters:
nIdQuiz - The quiz Id
group - The group
plugin - The plugin

changePositionDown

public void changePositionDown(int nIdQuiz,
                               QuestionGroup group,
                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Move down a group

Specified by:
changePositionDown in interface IQuestionGroupDAO
Parameters:
nIdQuiz - The quiz Id
group - The group
plugin - The plugin


Copyright © 2011 Mairie de Paris. All Rights Reserved.