Class ContactListDAO
java.lang.Object
fr.paris.lutece.plugins.contact.business.ContactListDAO
- All Implemented Interfaces:
IContactListDAO
This class provides Data Access methods for Contact objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassign(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Inserts 2 keys in association tableintcountContactsForList(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) counts how many contacts are associated to the specified listintcountListsForContact(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) counts how many lists the contact is associated tovoiddelete(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete a record from the tablevoidinsert(ContactList contactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new record in the table.booleanisAssigned(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) returns true if a contact is assigned to a listbooleanlistExists(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns true if the contactList existsload(int nContactListId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the data of Contact from the tableintmaxOrderContact(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Calculate the new max order in a listintmaxOrderContactList(fr.paris.lutece.portal.service.plugin.Plugin plugin) Calculate the new max order in a listselectAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the list of contactsListselectAssignedListsFor(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) Selects assigned lists for a contactselectByRoleKey(String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Selects lists for a role keyintselectContactListIdByOrder(int nContactListOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a contact identifier in a distinct orderintselectContactListOrderById(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the order of a contactListselectContactListsByIds(List<Integer> listIds, fr.paris.lutece.portal.service.plugin.Plugin plugin) Load the data of all the contactlist objects and returns them as a listselectContactsForList(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Selects all contacts associated to a specified listselectNotAssignedContactsFor(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Selects the list of all contacts that are not assigned to the specified listselectNotAssignedListsFor(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) selects all lists, the contact is not associated tovoidstore(ContactList contactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the record in the tablevoidstoreContactListOrder(int nNewOrder, int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Modify the order of a contactvoidunAssign(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Unassigns a contact of a list, or a list of a contactvoidunassignContactsForList(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Unassigns all contacts for a specified listvoidunassignListsForContact(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) Unassigns all lists, the specified contact is assigned to
-
Constructor Details
-
ContactListDAO
public ContactListDAO()
-
-
Method Details
-
insert
Insert a new record in the table.- Specified by:
insertin interfaceIContactListDAO- Parameters:
contactList- the instance of contactList to insert into DBplugin- the plugin contact
-
load
Load the data of Contact from the table- Specified by:
loadin interfaceIContactListDAO- Parameters:
nContactListId- the Id of the contactList to loadplugin- the plugin contact- Returns:
- the instance of contactList object loaded
-
selectAll
Load the list of contactsList- Specified by:
selectAllin interfaceIContactListDAO- Parameters:
plugin- The plugin- Returns:
- The Collection of the Contacts
-
selectByRoleKey
public Collection<ContactList> selectByRoleKey(String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Selects lists for a role key- Specified by:
selectByRoleKeyin interfaceIContactListDAO- Parameters:
strRoleKey- The role keyplugin- the plugin contact- Returns:
- collection of lists
-
countContactsForList
public int countContactsForList(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) counts how many contacts are associated to the specified list- Specified by:
countContactsForListin interfaceIContactListDAO- Parameters:
nIdContactList- the Id of contactListplugin- the plugin contact- Returns:
- the number of contacts for the list
-
countListsForContact
public int countListsForContact(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) counts how many lists the contact is associated to- Specified by:
countListsForContactin interfaceIContactListDAO- Parameters:
nIdContact- the Id of concerned contactplugin- the plugin contact- Returns:
- the number of counted lists
-
listExists
public boolean listExists(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns true if the contactList exists- Specified by:
listExistsin interfaceIContactListDAO- Parameters:
nIdContactList- The if of contactListplugin- The Plugin object- Returns:
- boolean the existance of the list
-
selectContactsForList
public Collection<Contact> selectContactsForList(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Selects all contacts associated to a specified list- Specified by:
selectContactsForListin interfaceIContactListDAO- Parameters:
nIdContactList- the id of contactListplugin- the plugin contact- Returns:
- list of contacts
-
isAssigned
public boolean isAssigned(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) returns true if a contact is assigned to a list- Specified by:
isAssignedin interfaceIContactListDAO- Parameters:
nIdContact- The id of the contactnIdContactList- The id of the contactListplugin- the plugin contact- Returns:
- boolean: true if is assigned, false if not
-
assign
public void assign(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Inserts 2 keys in association table- Specified by:
assignin interfaceIContactListDAO- Parameters:
nIdContact- The id of the contactnIdContactList- The contact List that will be associatedplugin- The plugin
-
unAssign
public void unAssign(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Unassigns a contact of a list, or a list of a contact- Specified by:
unAssignin interfaceIContactListDAO- Parameters:
nIdContact- the id of the contactnIdContactList- the id of the contactListplugin- The plugin
-
selectNotAssignedContactsFor
public Collection<Contact> selectNotAssignedContactsFor(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Selects the list of all contacts that are not assigned to the specified list- Specified by:
selectNotAssignedContactsForin interfaceIContactListDAO- Parameters:
nIdContactList- the id of the contact Listplugin- the plugin contact- Returns:
- list of not assigned contacts
-
selectAssignedListsFor
public Collection<ContactList> selectAssignedListsFor(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) Selects assigned lists for a contact- Specified by:
selectAssignedListsForin interfaceIContactListDAO- Parameters:
nIdContact- the id of the contactplugin- the plugin contact- Returns:
- collection of lists, the contact is associated to
-
selectNotAssignedListsFor
public Collection<ContactList> selectNotAssignedListsFor(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) selects all lists, the contact is not associated to- Specified by:
selectNotAssignedListsForin interfaceIContactListDAO- Parameters:
nIdContact- the id of the contactplugin- the plugin contact- Returns:
- collection of contactLists
-
delete
public void delete(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete a record from the table- Specified by:
deletein interfaceIContactListDAO- Parameters:
nIdContactList- the id of contactlist to deleteplugin- The plugin
-
unassignContactsForList
public void unassignContactsForList(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Unassigns all contacts for a specified list- Specified by:
unassignContactsForListin interfaceIContactListDAO- Parameters:
nIdContactList- the id of contactlistplugin- the plugin contact
-
unassignListsForContact
public void unassignListsForContact(int nIdContact, fr.paris.lutece.portal.service.plugin.Plugin plugin) Unassigns all lists, the specified contact is assigned to- Specified by:
unassignListsForContactin interfaceIContactListDAO- Parameters:
nIdContact- the Id of the contactplugin- the plugin contact
-
store
Update the record in the table- Specified by:
storein interfaceIContactListDAO- Parameters:
contactList- The reference of contactListplugin- The plugin
-
storeContactListOrder
public void storeContactListOrder(int nNewOrder, int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Modify the order of a contact- Specified by:
storeContactListOrderin interfaceIContactListDAO- Parameters:
nNewOrder- The order numbernId- The contactList identifierplugin- The plugin
-
selectContactListIdByOrder
public int selectContactListIdByOrder(int nContactListOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a contact identifier in a distinct order- Specified by:
selectContactListIdByOrderin interfaceIContactListDAO- Parameters:
nContactListOrder- The order numberplugin- The plugin- Returns:
- The order of the ContactList
-
selectContactListOrderById
public int selectContactListOrderById(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the order of a contactList- Specified by:
selectContactListOrderByIdin interfaceIContactListDAO- Parameters:
nIdContactList- the id of contactListplugin- the plugin contact- Returns:
- the order of the contactList
-
maxOrderContactList
public int maxOrderContactList(fr.paris.lutece.portal.service.plugin.Plugin plugin) Calculate the new max order in a list- Specified by:
maxOrderContactListin interfaceIContactListDAO- Parameters:
plugin- The plugin- Returns:
- the max order of contact
-
maxOrderContact
public int maxOrderContact(int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin) Calculate the new max order in a list- Specified by:
maxOrderContactin interfaceIContactListDAO- Parameters:
nIdContactList- the id of the contact listplugin- The plugin- Returns:
- the max order of contact
-
selectContactListsByIds
public List<ContactList> selectContactListsByIds(List<Integer> listIds, fr.paris.lutece.portal.service.plugin.Plugin plugin) Description copied from interface:IContactListDAOLoad the data of all the contactlist objects and returns them as a list- Specified by:
selectContactListsByIdsin interfaceIContactListDAO- Parameters:
listIds- list of idsplugin- The plugin- Returns:
- The list which contains the data of all the contactlist objects
-