Class NewsletterTopicDao
java.lang.Object
fr.paris.lutece.plugins.newsletter.business.topic.NewsletterTopicDao
- All Implemented Interfaces:
INewsletterTopicDAO
DAO implementation for
NewsletterTopic-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfillBlankInOrder(int nIdNewsletter, int nOrder, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin) Fill a blank in the order of topics of a newsletter.findAllByIdNewsletter(int nIdNewsletter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list ofNewsletterTopicassociated with a given newsletter.findByNewsletterIdAndOrder(int nIdNewsletter, int nOrder, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of newsletter topics associated to a given newsletter and with the given order in a sectionfindByPrimaryKey(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get aNewsletterTopicby its primary key from the databaseintgetLastOrder(int nIdNewsletter, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the highest order for a given newsletter and a given sectionintgetNewOrder(int nIdNewsletter, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the next available order value for topics of a newslettervoidinsert(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a newNewsletterTopicinto the databasevoidremove(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete aNewsletterTopicfrom the databasevoidremoveAllByIdNewsletter(int nIdNewsletter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove every topic associated with a given newslettervoidupdate(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update aNewsletterTopicin the databasevoidupdateNewsletterTopicOrder(int nIdNewsletterTopic, int nNewOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the order of a newsletter topic
-
Constructor Details
-
NewsletterTopicDao
public NewsletterTopicDao()
-
-
Method Details
-
findByPrimaryKey
public NewsletterTopic findByPrimaryKey(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get aNewsletterTopicby its primary key from the database- Specified by:
findByPrimaryKeyin interfaceINewsletterTopicDAO- Parameters:
nId- The id of theNewsletterTopicto getplugin- The plugin- Returns:
- The
NewsletterTopicwith the given id, or null if noNewsletterTopichas this id.
-
insert
public void insert(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a newNewsletterTopicinto the database- Specified by:
insertin interfaceINewsletterTopicDAO- Parameters:
newsletterTopic- TheNewsletterTopicto insert.plugin- The plugin
-
update
public void update(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update aNewsletterTopicin the database- Specified by:
updatein interfaceINewsletterTopicDAO- Parameters:
newsletterTopic- The new values of theNewsletterTopic.plugin- The plugin
-
remove
public void remove(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete aNewsletterTopicfrom the database- Specified by:
removein interfaceINewsletterTopicDAO- Parameters:
nId- The id of theNewsletterTopicto delete.plugin- The plugin
-
findAllByIdNewsletter
public List<NewsletterTopic> findAllByIdNewsletter(int nIdNewsletter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list ofNewsletterTopicassociated with a given newsletter.- Specified by:
findAllByIdNewsletterin interfaceINewsletterTopicDAO- Parameters:
nIdNewsletter- The id of the newsletterplugin- The plugin- Returns:
- The list of
NewsletterTopicfound.
-
updateNewsletterTopicOrder
public void updateNewsletterTopicOrder(int nIdNewsletterTopic, int nNewOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the order of a newsletter topic- Specified by:
updateNewsletterTopicOrderin interfaceINewsletterTopicDAO- Parameters:
nIdNewsletterTopic- The id of the newsletter topic to updatenNewOrder- The new order of the topicplugin- The plugin
-
findByNewsletterIdAndOrder
public List<NewsletterTopic> findByNewsletterIdAndOrder(int nIdNewsletter, int nOrder, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the list of newsletter topics associated to a given newsletter and with the given order in a section- Specified by:
findByNewsletterIdAndOrderin interfaceINewsletterTopicDAO- Parameters:
nIdNewsletter- The id of the newsletter the topic must be associated with.nOrder- The order the topics must havenSection- The section of the Topicplugin- The plugin- Returns:
- The list of newsletter topics. The list should contain only one or zero element. If it has more, then it indicates that several topics have the same order and should be reordered.
-
getNewOrder
public int getNewOrder(int nIdNewsletter, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the next available order value for topics of a newsletter- Specified by:
getNewOrderin interfaceINewsletterTopicDAO- Parameters:
nIdNewsletter- The id of the newsletternSection- The section of the newsletterplugin- The plugin- Returns:
- The next available order value
-
getLastOrder
public int getLastOrder(int nIdNewsletter, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the highest order for a given newsletter and a given section- Specified by:
getLastOrderin interfaceINewsletterTopicDAO- Parameters:
nIdNewsletter- The id of the newsletternSection- The id of the sectionplugin- The plugin- Returns:
- The highest order actually used for the given newsletter and the given section
-
fillBlankInOrder
public void fillBlankInOrder(int nIdNewsletter, int nOrder, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin) Fill a blank in the order of topics of a newsletter.- Specified by:
fillBlankInOrderin interfaceINewsletterTopicDAO- Parameters:
nIdNewsletter- The newsletter to update the topics ofnOrder- The order with no topicnSection- The section of topics to updateplugin- the plugin
-
removeAllByIdNewsletter
public void removeAllByIdNewsletter(int nIdNewsletter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove every topic associated with a given newsletter- Specified by:
removeAllByIdNewsletterin interfaceINewsletterTopicDAO- Parameters:
nIdNewsletter- The id of the newsletter to remove the topics of.plugin- The plugin
-