fr.paris.lutece.plugins.appointment.business
Class AppointmentDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.appointment.business.AppointmentDAO
All Implemented Interfaces:
IAppointmentDAO

public final class AppointmentDAO
extends Object
implements IAppointmentDAO

This class provides Data Access methods for Appointment objects


Constructor Summary
AppointmentDAO()
           
 
Method Summary
 int countAppointmentsByIdForm(int nIdForm, Date date, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the number of appointments associated with a given form and with a date after a given date
 void delete(int nAppointmentId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete a record from the table
 void deleteAppointmentResponse(int nIdAppointment, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove the association between an appointment and responses
 int findIdAppointmentByIdResponse(int nIdResponse, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Find the id of the appointment associated with a given response
 List<Integer> findListIdResponse(int nIdAppointment, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of id of responses associated with an appointment
 int getNbAppointmentByIdDay(Date dateAppointment, int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the number of appointment of a given date and associated with a given form
 void insert(Appointment appointment, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new record in the table.
 void insertAppointmentResponse(int nIdAppointment, int nIdResponse, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Associates a response to an appointment
 Appointment load(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data from the table
 int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Generates a new primary key
 void removeAppointmentResponsesByIdResponse(int nIdResponse, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove an appointment responses from the id of a response.
 List<Integer> selectAppointmentIdByFilter(AppointmentFilter appointmentFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of ids of appointments matching a given filter
 List<Appointment> selectAppointmentListByFilter(AppointmentFilter appointmentFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of appointments matching a given filter
 List<Appointment> selectAppointmentListById(List<Integer> listIdAppointments, String strOrderBy, boolean bSortAsc, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get a list of appointments from their ids
 List<Appointment> selectAppointmentsList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of all the appointment objects and returns them as a collection
 List<Appointment> selectAppointmentsListByIdForm(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of appointment objects associated with a given form and returns them in a collection
 void store(Appointment appointment, 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

AppointmentDAO

public AppointmentDAO()
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

insert

public void insert(Appointment appointment,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new record in the table.

Specified by:
insert in interface IAppointmentDAO
Parameters:
appointment - instance of the Appointment object to insert
plugin - the Plugin

load

public Appointment load(int nKey,
                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data from the table

Specified by:
load in interface IAppointmentDAO
Parameters:
nKey - The identifier of the appointment
plugin - the Plugin
Returns:
The instance of the appointment

delete

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

Specified by:
delete in interface IAppointmentDAO
Parameters:
nAppointmentId - int identifier of the Appointment to delete
plugin - the Plugin

store

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

Specified by:
store in interface IAppointmentDAO
Parameters:
appointment - the reference of the Appointment
plugin - the Plugin

selectAppointmentsList

public List<Appointment> selectAppointmentsList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of all the appointment objects and returns them as a collection

Specified by:
selectAppointmentsList in interface IAppointmentDAO
Parameters:
plugin - the Plugin
Returns:
The collection which contains the data of all the appointment objects

selectAppointmentsListByIdForm

public List<Appointment> selectAppointmentsListByIdForm(int nIdForm,
                                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of appointment objects associated with a given form and returns them in a collection

Specified by:
selectAppointmentsListByIdForm in interface IAppointmentDAO
Parameters:
nIdForm - the id of the form
plugin - the Plugin
Returns:
the collection which contains the data of appointment objects

selectAppointmentListByFilter

public List<Appointment> selectAppointmentListByFilter(AppointmentFilter appointmentFilter,
                                                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of appointments matching a given filter

Specified by:
selectAppointmentListByFilter in interface IAppointmentDAO
Parameters:
appointmentFilter - The filter appointments must match
plugin - The plugin
Returns:
The list of appointments that match the given filter

selectAppointmentIdByFilter

public List<Integer> selectAppointmentIdByFilter(AppointmentFilter appointmentFilter,
                                                 fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of ids of appointments matching a given filter

Specified by:
selectAppointmentIdByFilter in interface IAppointmentDAO
Parameters:
appointmentFilter - The filter appointments must match
plugin - The plugin
Returns:
The list of ids of appointments that match the given filter

selectAppointmentListById

public List<Appointment> selectAppointmentListById(List<Integer> listIdAppointments,
                                                   String strOrderBy,
                                                   boolean bSortAsc,
                                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get a list of appointments from their ids

Specified by:
selectAppointmentListById in interface IAppointmentDAO
Parameters:
listIdAppointments - The list of ids of appointments to get
strOrderBy - The name of the column to sort rows
bSortAsc - True to sort ascending, false otherwise
plugin - The plugin
Returns:
The list of appointments which ids are given in parameters

getNbAppointmentByIdDay

public int getNbAppointmentByIdDay(Date dateAppointment,
                                   int nIdForm,
                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the number of appointment of a given date and associated with a given form

Specified by:
getNbAppointmentByIdDay in interface IAppointmentDAO
Parameters:
dateAppointment - The date of appointments to count
nIdForm - The id of the appointment form
plugin - The plugin
Returns:
the number of appointments, or 0 if no appointment was found

insertAppointmentResponse

public void insertAppointmentResponse(int nIdAppointment,
                                      int nIdResponse,
                                      fr.paris.lutece.portal.service.plugin.Plugin plugin)
Associates a response to an appointment

Specified by:
insertAppointmentResponse in interface IAppointmentDAO
Parameters:
nIdAppointment - The id of the appointment
nIdResponse - The id of the response
plugin - The plugin

findListIdResponse

public List<Integer> findListIdResponse(int nIdAppointment,
                                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of id of responses associated with an appointment

Specified by:
findListIdResponse in interface IAppointmentDAO
Parameters:
nIdAppointment - the id of the appointment
plugin - the plugin
Returns:
the list of responses, or an empty list if no response was found

deleteAppointmentResponse

public void deleteAppointmentResponse(int nIdAppointment,
                                      fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove the association between an appointment and responses

Specified by:
deleteAppointmentResponse in interface IAppointmentDAO
Parameters:
nIdAppointment - The id of the appointment
plugin - The plugin

removeAppointmentResponsesByIdResponse

public void removeAppointmentResponsesByIdResponse(int nIdResponse,
                                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove an appointment responses from the id of a response.

Specified by:
removeAppointmentResponsesByIdResponse in interface IAppointmentDAO
Parameters:
nIdResponse - The id of the response
plugin - The plugin

countAppointmentsByIdForm

public int countAppointmentsByIdForm(int nIdForm,
                                     Date date,
                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the number of appointments associated with a given form and with a date after a given date

Specified by:
countAppointmentsByIdForm in interface IAppointmentDAO
Parameters:
nIdForm - The id of the form
date - The minimum date of appointments to consider
plugin - The plugin
Returns:
The number of appointments associated with the form

findIdAppointmentByIdResponse

public int findIdAppointmentByIdResponse(int nIdResponse,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Find the id of the appointment associated with a given response

Specified by:
findIdAppointmentByIdResponse in interface IAppointmentDAO
Parameters:
nIdResponse - The id of the response
plugin - The plugin
Returns:
The id of the appointment, or 0 if no appointment is associated with he given response.


Copyright © 2014 Mairie de Paris. All Rights Reserved.