Class SubscriberDAO
- java.lang.Object
-
- fr.paris.lutece.plugins.newsletter.business.SubscriberDAO
-
- All Implemented Interfaces:
ISubscriberDAO
public final class SubscriberDAO extends java.lang.Object implements ISubscriberDAO
This class provides Data Access methods for subscriber objects
-
-
Constructor Summary
Constructors Constructor Description SubscriberDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Delete a record from the tablevoidinsert(Subscriber subscriber, fr.paris.lutece.portal.service.plugin.Plugin plugin)Insert a new record in the table.Subscriberload(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)loads data from a subscriber's identifierjava.util.Collection<Subscriber>selectAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)Loads the list of subscribersSubscriberselectByEmail(java.lang.String strEmail, fr.paris.lutece.portal.service.plugin.Plugin plugin)Finds a subscriber from his emailintselectNewsLetters(int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Returns, for a subscriber, the number of his subscriptionsjava.util.Collection<Subscriber>selectSubscribers(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin)loads the list of subscribers for a newsletterjava.util.Collection<Subscriber>selectSubscribers(int nNewsLetterId, java.lang.String strSearchString, int nBegin, int nEnd, fr.paris.lutece.portal.service.plugin.Plugin plugin)loads the list of subscribers for a newsletterjava.util.Collection<Subscriber>selectSubscribersForSending(int nNewsLetterId, java.lang.String strSearchString, int nBegin, int nEnd, fr.paris.lutece.portal.service.plugin.Plugin plugin)loads the list of subscribers for a newsletterjava.util.Collection<Subscriber>selectSubscribersList(fr.paris.lutece.portal.service.plugin.Plugin plugin)loads the list of subscribers
-
-
-
Method Detail
-
insert
public void insert(Subscriber subscriber, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new record in the table.- Specified by:
insertin interfaceISubscriberDAO- Parameters:
subscriber- the object to be insertedplugin- the Plugin
-
delete
public void delete(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Delete a record from the table- Specified by:
deletein interfaceISubscriberDAO- Parameters:
nId- the subscriber's identifierplugin- the Plugin
-
load
public Subscriber load(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
loads data from a subscriber's identifier- Specified by:
loadin interfaceISubscriberDAO- Parameters:
nId- the subscriber's identifierplugin- the Plugin- Returns:
- an object Subscriber
-
selectAll
public java.util.Collection<Subscriber> selectAll(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Loads the list of subscribers- Specified by:
selectAllin interfaceISubscriberDAO- Parameters:
plugin- the Plugin- Returns:
- a collection of objects Subscriber
-
selectByEmail
public Subscriber selectByEmail(java.lang.String strEmail, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Finds a subscriber from his email- Specified by:
selectByEmailin interfaceISubscriberDAO- Parameters:
strEmail- the subscriber's emailplugin- the Plugin- Returns:
- a subscriber object if it exists, null if not
-
selectSubscribers
public java.util.Collection<Subscriber> selectSubscribers(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
loads the list of subscribers for a newsletter- Specified by:
selectSubscribersin interfaceISubscriberDAO- Parameters:
nNewsLetterId- the newsletter identifierplugin- the Plugin- Returns:
- a collection of subscribers
-
selectSubscribers
public java.util.Collection<Subscriber> selectSubscribers(int nNewsLetterId, java.lang.String strSearchString, int nBegin, int nEnd, fr.paris.lutece.portal.service.plugin.Plugin plugin)
loads the list of subscribers for a newsletter- Specified by:
selectSubscribersin interfaceISubscriberDAO- Parameters:
nNewsLetterId- the newsletter identifierstrSearchString- gets all the subscribers if null or empty and gets the subscribers whith an email containing this string otherwisenBegin- the rank of the first subscriber to returnnEnd- the maximum number of suscribers to returnplugin- the Plugin- Returns:
- a collection of subscribers
-
selectSubscribersForSending
public java.util.Collection<Subscriber> selectSubscribersForSending(int nNewsLetterId, java.lang.String strSearchString, int nBegin, int nEnd, fr.paris.lutece.portal.service.plugin.Plugin plugin)
loads the list of subscribers for a newsletter- Specified by:
selectSubscribersForSendingin interfaceISubscriberDAO- Parameters:
nNewsLetterId- the newsletter identifierstrSearchString- gets all the subscribers if null or empty and gets the subscribers whith an email containing this string otherwisenBegin- the rank of the first subscriber to returnnEnd- the maximum number of suscribers to returnplugin- the Plugin- Returns:
- a collection of subscribers
-
selectNewsLetters
public int selectNewsLetters(int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Returns, for a subscriber, the number of his subscriptions- Specified by:
selectNewsLettersin interfaceISubscriberDAO- Parameters:
nSubscriberId- the subscriber's identifierplugin- the Plugin- Returns:
- the number of subscriptions
-
selectSubscribersList
public java.util.Collection<Subscriber> selectSubscribersList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
loads the list of subscribers- Specified by:
selectSubscribersListin interfaceISubscriberDAO- Parameters:
plugin- the Plugin- Returns:
- a collection of subscribers
-
-