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

java.lang.Object
  extended by fr.paris.lutece.plugins.appointment.business.AppointmentHome

public final class AppointmentHome
extends Object

This class provides instances management methods (create, find, ...) for Appointment objects


Method Summary
static int countAppointmentsByIdForm(int nIdForm, Date date)
          Get the number of appointments associated with a given form and with a date after a given date
static Appointment create(Appointment appointment)
          Create an instance of the appointment class
static Appointment findByPrimaryKey(int nKey)
          Returns an instance of a appointment whose identifier is specified in parameter
static int findIdAppointmentByIdResponse(int nIdResponse)
          Find the id of the appointment associated with a given response
static List<Integer> findListIdResponse(int nIdAppointment)
          Get the list of id of responses associated with an appointment
static List<fr.paris.lutece.plugins.genericattributes.business.Response> findListResponse(int nIdAppointment)
          Get the list of responses associated with an appointment
static List<Integer> getAppointmentIdByFilter(AppointmentFilter appointmentFilter)
          Get the list of ids of appointments matching a given filter
static List<Appointment> getAppointmentListByFilter(AppointmentFilter appointmentFilter)
          Get the list of appointments matching a given filter
static List<Appointment> getAppointmentListById(List<Integer> listIdAppointments)
          Get a list of appointments from their ids
static List<Appointment> getAppointmentListById(List<Integer> listIdAppointments, String strOrderBy, boolean bSortAsc)
          Get a list of appointments from their ids
static List<Appointment> getAppointmentsList()
          Load the data of all the appointment objects and returns them in form of a collection
static List<Appointment> getAppointmentsListByIdForm(int nIdForm)
          Load the data of appointment objects associated with a given form and returns them in a collection
static int getNbAppointmentByIdDay(Date dateAppointment, int nIdForm)
          Get the number of appointment of a given date and associated with a given form
static void insertAppointmentResponse(int nIdAppointment, int nIdResponse)
          Associates a response to an appointment
static void remove(int nAppointmentId)
          Remove the appointment whose identifier is specified in parameter, and removed any associated response
static void removeAppointmentResponse(int nIdAppointment)
          Remove the association between an appointment and responses
static void removeResponsesByIdEntry(int nIdEntry)
          Remove every appointment responses associated with a given entry.
static Appointment update(Appointment appointment)
          Update of the appointment which is specified in parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Appointment create(Appointment appointment)
Create an instance of the appointment class

Parameters:
appointment - The instance of the Appointment which contains the informations to store
Returns:
The instance of appointment which has been created with its primary key.

update

public static Appointment update(Appointment appointment)
Update of the appointment which is specified in parameter

Parameters:
appointment - The instance of the Appointment which contains the data to store
Returns:
The instance of the appointment which has been updated

remove

public static void remove(int nAppointmentId)
Remove the appointment whose identifier is specified in parameter, and removed any associated response

Parameters:
nAppointmentId - The appointment Id

findByPrimaryKey

public static Appointment findByPrimaryKey(int nKey)
Returns an instance of a appointment whose identifier is specified in parameter

Parameters:
nKey - The appointment primary key
Returns:
an instance of Appointment

getAppointmentsList

public static List<Appointment> getAppointmentsList()
Load the data of all the appointment objects and returns them in form of a collection

Returns:
the collection which contains the data of all the appointment objects

countAppointmentsByIdForm

public static int countAppointmentsByIdForm(int nIdForm,
                                            Date date)
Get the number of appointments associated with a given form and with a date after a given date

Parameters:
nIdForm - The id of the form
date - The minimum date of appointments to consider
Returns:
The number of appointments associated with the form

getAppointmentsListByIdForm

public static List<Appointment> getAppointmentsListByIdForm(int nIdForm)
Load the data of appointment objects associated with a given form and returns them in a collection

Parameters:
nIdForm - the id of the form
Returns:
the collection which contains the data of appointment objects

getAppointmentListByFilter

public static List<Appointment> getAppointmentListByFilter(AppointmentFilter appointmentFilter)
Get the list of appointments matching a given filter

Parameters:
appointmentFilter - The filter appointments must match
Returns:
The list of appointments that match the given filter

getAppointmentIdByFilter

public static List<Integer> getAppointmentIdByFilter(AppointmentFilter appointmentFilter)
Get the list of ids of appointments matching a given filter

Parameters:
appointmentFilter - The filter appointments must match
Returns:
The list of ids of appointments that match the given filter

getAppointmentListById

public static List<Appointment> getAppointmentListById(List<Integer> listIdAppointments)
Get a list of appointments from their ids

Parameters:
listIdAppointments - The list of ids of appointments to get
Returns:
The list of appointments which ids are given in parameters

getAppointmentListById

public static List<Appointment> getAppointmentListById(List<Integer> listIdAppointments,
                                                       String strOrderBy,
                                                       boolean bSortAsc)
Get a list of appointments from their ids

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
Returns:
The list of appointments which ids are given in parameters

getNbAppointmentByIdDay

public static int getNbAppointmentByIdDay(Date dateAppointment,
                                          int nIdForm)
Get the number of appointment of a given date and associated with a given form

Parameters:
dateAppointment - The date of appointments to count
nIdForm - The id of the appointment form
Returns:
the number of appointments, or 0 if no appointment was found

insertAppointmentResponse

public static void insertAppointmentResponse(int nIdAppointment,
                                             int nIdResponse)
Associates a response to an appointment

Parameters:
nIdAppointment - The id of the appointment
nIdResponse - The id of the response

findListIdResponse

public static List<Integer> findListIdResponse(int nIdAppointment)
Get the list of id of responses associated with an appointment

Parameters:
nIdAppointment - the id of the appointment
Returns:
the list of responses, or an empty list if no response was found

findListResponse

public static List<fr.paris.lutece.plugins.genericattributes.business.Response> findListResponse(int nIdAppointment)
Get the list of responses associated with an appointment

Parameters:
nIdAppointment - the id of the appointment
Returns:
the list of responses, or an empty list if no response was found

findIdAppointmentByIdResponse

public static int findIdAppointmentByIdResponse(int nIdResponse)
Find the id of the appointment associated with a given response

Parameters:
nIdResponse - The id of the response
Returns:
The id of the appointment, or 0 if no appointment is associated with he given response.

removeAppointmentResponse

public static void removeAppointmentResponse(int nIdAppointment)
Remove the association between an appointment and responses

Parameters:
nIdAppointment - The id of the appointment

removeResponsesByIdEntry

public static void removeResponsesByIdEntry(int nIdEntry)
Remove every appointment responses associated with a given entry.

Parameters:
nIdEntry - The id of the entry


Copyright © 2014 Mairie de Paris. All Rights Reserved.