Class ContactDAO

java.lang.Object
fr.paris.lutece.plugins.contact.business.ContactDAO
All Implemented Interfaces:
IContactDAO

@ApplicationScoped public final class ContactDAO extends Object implements IContactDAO
This class provides Data Access methods for Contact objects
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(Contact contact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Delete a record from the table
    void
    insert(Contact contact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Insert a new record in the table.
    load(int nContactId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Load the data of Contact from the table
    selectAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Load the list of contacts
    int
    selectContactIdByOrder(int nContactOrder, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Returns a contact identifier in a distinct order
    int
    selectContactOrderById(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Returns the order of a contact in a list, using the Identifier
    fr.paris.lutece.util.ReferenceList
    selectContactsByListWithString(int nIdContactList, String strComboItem, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Load the list of contacts
    selectContactsListByIds(List<Integer> listIds, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Load the data of all the contact objects and returns them as a list
    void
    store(Contact contact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Update the record in the table
    void
    storeContactOrder(int nNewOrder, int nId, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Modify the order of a contact
    void
    updateHits(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Update hits of the contact in contact and contact_list_contact tables

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ContactDAO

      public ContactDAO()
  • Method Details

    • insert

      public void insert(Contact contact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Insert a new record in the table.
      Specified by:
      insert in interface IContactDAO
      Parameters:
      contact - The contact object
      plugin - The plugin
    • load

      public Contact load(int nContactId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the data of Contact from the table
      Specified by:
      load in interface IContactDAO
      Parameters:
      nContactId - The identifier of Contact
      plugin - The plugin
      Returns:
      the instance of the Contact
    • delete

      public void delete(Contact contact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete a record from the table
      Specified by:
      delete in interface IContactDAO
      Parameters:
      contact - The Contact object
      plugin - The plugin
    • store

      public void store(Contact contact, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update the record in the table
      Specified by:
      store in interface IContactDAO
      Parameters:
      contact - The reference of contact
      plugin - The plugin
    • selectContactsByListWithString

      public fr.paris.lutece.util.ReferenceList selectContactsByListWithString(int nIdContactList, String strComboItem, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the list of contacts
      Specified by:
      selectContactsByListWithString in interface IContactDAO
      Parameters:
      nIdContactList - The id of contact List
      strComboItem - the string to display at the top of the list
      plugin - The plugin
      Returns:
      The Collection of the Contacts with the string at the top
    • selectAll

      public Collection<Contact> selectAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Load the list of contacts
      Specified by:
      selectAll in interface IContactDAO
      Parameters:
      plugin - The plugin
      Returns:
      The Collection of the Contacts
    • updateHits

      public void updateHits(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update hits of the contact in contact and contact_list_contact tables
      Specified by:
      updateHits in interface IContactDAO
      Parameters:
      nIdContact - id of the contact
      nIdContactList - id of contact list
      plugin - the plugin Contact
    • storeContactOrder

      public void storeContactOrder(int nNewOrder, int nId, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Modify the order of a contact
      Specified by:
      storeContactOrder in interface IContactDAO
      Parameters:
      nIdContactList - The id of contactList
      nNewOrder - The order number
      nId - The contact identifier
      plugin - The plugin
    • selectContactIdByOrder

      public int selectContactIdByOrder(int nContactOrder, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns a contact identifier in a distinct order
      Specified by:
      selectContactIdByOrder in interface IContactDAO
      Parameters:
      nIdContactList - the id of the contact List
      nContactOrder - The order number
      plugin - The plugin
      Returns:
      The order of the Contact
    • selectContactOrderById

      public int selectContactOrderById(int nIdContact, int nIdContactList, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns the order of a contact in a list, using the Identifier
      Specified by:
      selectContactOrderById in interface IContactDAO
      Parameters:
      nIdContact - the id of contact
      nIdContactList - the id of contactList
      plugin - the plugin contact
      Returns:
      the order of the contact in the list
    • selectContactsListByIds

      public List<Contact> selectContactsListByIds(List<Integer> listIds, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Description copied from interface: IContactDAO
      Load the data of all the contact objects and returns them as a list
      Specified by:
      selectContactsListByIds in interface IContactDAO
      Parameters:
      listIds - list of ids
      plugin - The plugin
      Returns:
      The list which contains the data of all the contact objects