Class SubjectDAO

java.lang.Object
fr.paris.lutece.plugins.helpdesk.business.SubjectDAO
All Implemented Interfaces:
IAbstractSubjectDAO, ISubjectDAO

public final class SubjectDAO extends Object implements ISubjectDAO
This class provides Data Access methods for Subject objects
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    countQuestion(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    return the count of all announce for Field
    void
    delete(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Delete a record from the table
    void
    deleteAllLinksToFaq(int nIdAbstractSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    delete a record in the table.
    void
    deleteLinkToFaq(int nIdAbstractSubject, int nIdFaq, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    delete a record in the table.
    findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Finds all objects of this type
    findByFaqOrder(int nIdFaq, int nOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Find a subject with the faq id and the order.
    findByIdFaq(int nIdFaq, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Finds all Subject specified by the Faq id
    findByIdParent(int nIdParent, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Finds all Subject specified by the parent id
    findByOrder(int nIdParent, int nOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Find a subject with the parent id and the order.
    findQuestions(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Returns all questions on a subject
    fr.paris.lutece.util.ReferenceList
    findSubject(fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Finds all objects of this type
    int
    getMaxOrder(int nIdParent, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Get the max order of a parent subject
    void
    insert(AbstractSubject abstractSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Insert a new record in the table.
    void
    insertLinkToFaq(int nIdAbstractSubject, int nIdFaq, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Insert a new record in the table.
    load(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    load the data of Subject from the table
    int
    newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Calculate a new primary key to add a new Subject
    void
    store(AbstractSubject abstractSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Update the record in the table

    Methods inherited from class java.lang.Object

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

    • SubjectDAO

      public SubjectDAO()
  • Method Details

    • newPrimaryKey

      public int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Calculate a new primary key to add a new Subject
      Specified by:
      newPrimaryKey in interface IAbstractSubjectDAO
      Parameters:
      plugin - The Plugin using this data access service
      Returns:
      The new key.
    • insert

      public void insert(AbstractSubject abstractSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Insert a new record in the table.
      Specified by:
      insert in interface IAbstractSubjectDAO
      Parameters:
      abstractSubject - The Instance of the object Subject
      plugin - The Plugin using this data access service
    • delete

      public void delete(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete a record from the table
      Specified by:
      delete in interface IAbstractSubjectDAO
      Parameters:
      nIdSubject - The indentifier of the object Subject
      plugin - The Plugin using this data access service
    • load

      public Subject load(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      load the data of Subject from the table
      Specified by:
      load in interface IAbstractSubjectDAO
      Parameters:
      nIdSubject - The indentifier of the object Subject
      plugin - The Plugin using this data access service
      Returns:
      The Instance of the object Subject
    • store

      public void store(AbstractSubject abstractSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update the record in the table
      Specified by:
      store in interface IAbstractSubjectDAO
      Parameters:
      abstractSubject - The instance of the Subject to update
      plugin - The Plugin using this data access service
    • findAll

      public List<? extends AbstractSubject> findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Finds all objects of this type
      Specified by:
      findAll in interface IAbstractSubjectDAO
      Parameters:
      plugin - The Plugin using this data access service
      Returns:
      A collection of objects
    • findSubject

      public fr.paris.lutece.util.ReferenceList findSubject(fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Finds all objects of this type
      Parameters:
      plugin - The Plugin using this data access service
      Returns:
      A collection of objects
    • findByIdParent

      public Collection<? extends AbstractSubject> findByIdParent(int nIdParent, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Finds all Subject specified by the parent id
      Specified by:
      findByIdParent in interface IAbstractSubjectDAO
      Parameters:
      nIdParent - The parent subject id
      plugin - The Plugin using this data access service
      Returns:
      A collection of Subject
    • findByIdFaq

      public Collection<? extends AbstractSubject> findByIdFaq(int nIdFaq, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Finds all Subject specified by the Faq id
      Specified by:
      findByIdFaq in interface IAbstractSubjectDAO
      Parameters:
      nIdFaq - The faq subject id
      plugin - The Plugin using this data access service
      Returns:
      A collection of Subject
    • findQuestions

      public List<QuestionAnswer> findQuestions(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns all questions on a subject
      Specified by:
      findQuestions in interface ISubjectDAO
      Parameters:
      nIdSubject - The identifier of the subject
      plugin - The Plugin using this data access service
      Returns:
      A collection of questions
    • countQuestion

      public int countQuestion(int nIdSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      return the count of all announce for Field
      Specified by:
      countQuestion in interface ISubjectDAO
      Parameters:
      plugin - The current plugin using this method
      nIdSubject - The subject ID
      Returns:
      count of announce for Field
    • getMaxOrder

      public int getMaxOrder(int nIdParent, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the max order of a parent subject
      Specified by:
      getMaxOrder in interface IAbstractSubjectDAO
      Parameters:
      nIdParent - The id of the parent subject
      plugin - The Plugin
      Returns:
      the max order
    • findByOrder

      public Subject findByOrder(int nIdParent, int nOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Find a subject with the parent id and the order.
      Specified by:
      findByOrder in interface IAbstractSubjectDAO
      Parameters:
      nIdParent - The parent Id
      nOrder - The order
      plugin - The Plugin
      Returns:
      the Subject
    • findByFaqOrder

      public Subject findByFaqOrder(int nIdFaq, int nOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Find a subject with the faq id and the order.
      Specified by:
      findByFaqOrder in interface IAbstractSubjectDAO
      Parameters:
      nIdFaq - The faq Id
      nOrder - The order
      plugin - The Plugin
      Returns:
      the Subject
    • insertLinkToFaq

      public void insertLinkToFaq(int nIdAbstractSubject, int nIdFaq, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Insert a new record in the table.
      Specified by:
      insertLinkToFaq in interface IAbstractSubjectDAO
      Parameters:
      nIdAbstractSubject - The id of the object Subject
      nIdFaq - The parent id of the object Faq
      plugin - The Plugin using this data access service
    • deleteLinkToFaq

      public void deleteLinkToFaq(int nIdAbstractSubject, int nIdFaq, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      delete a record in the table.
      Specified by:
      deleteLinkToFaq in interface IAbstractSubjectDAO
      Parameters:
      nIdAbstractSubject - The id of the object Subject
      nIdFaq - The parent id of the object Faq
      plugin - The Plugin using this data access service
    • deleteAllLinksToFaq

      public void deleteAllLinksToFaq(int nIdAbstractSubject, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      delete a record in the table.
      Specified by:
      deleteAllLinksToFaq in interface IAbstractSubjectDAO
      Parameters:
      nIdAbstractSubject - The id of the object Subject
      plugin - The Plugin using this data access service