com.stratelia.silverpeas.notificationManager.model
Class NotifPreferenceTable

java.lang.Object
  extended by com.stratelia.webactiv.util.AbstractTable<NotifPreferenceRow>
      extended by com.stratelia.silverpeas.notificationManager.model.NotifPreferenceTable

public class NotifPreferenceTable
extends AbstractTable<NotifPreferenceRow>


Field Summary
protected static String NOTIFPREFERENCE_COLUMNS
          The column list used for every select query.
 
Fields inherited from class com.stratelia.webactiv.util.AbstractTable
schema
 
Constructor Summary
NotifPreferenceTable(Schema schema)
          Builds a new NotifPreferenceTable
 
Method Summary
 int create(NotifPreferenceRow notifPreference)
          Inserts in the database a new NotifPreference row.
 void delete(int id)
          Deletes theNotifPreferenceRow. after having removed all the reference to it.
 void dereferenceComponentInstanceId(int componentInstanceId)
          Removes a reference to ComponentInstanceId
 void dereferenceUserId(int userId)
          Removes a reference to UserId
protected  NotifPreferenceRow fetchRow(ResultSet rs)
          Fetch the current NotifPreference row from a resultSet.
 NotifPreferenceRow[] getAllByComponentInstanceId(int componentInstanceId)
          Returns all the NotifPreferenceRow having a given componentInstanceId
 NotifPreferenceRow[] getAllByUserId(int userId)
          Returns all the NotifPreferenceRow having a given userId
 NotifPreferenceRow[] getAllRows()
          Returns all the rows.
 NotifPreferenceRow getByUserIdAndComponentInstanceIdAndMessageType(int userId, int componentInstanceId, int messageType)
          Returns the unique NotifPreference row having the given userId,componentInstanceId,messageType
 NotifPreferenceRow getNotifPreference(int id)
          Returns the unique NotifPreference row having a given id
 NotifPreferenceRow getNotifPreference(String query)
          Returns the unique row given by a no parameters query.
 NotifPreferenceRow[] getNotifPreferences(String query)
          Returns all the rows given by a no parameters query.
protected  void prepareInsert(String insertQuery, PreparedStatement insert, NotifPreferenceRow r)
          Prepares the statement to insert the given row
protected  void prepareUpdate(String updateQuery, PreparedStatement update, NotifPreferenceRow r)
          Prepares the statement to update the given row
 void save(NotifPreferenceRow notifPreference)
          Updates theNotifPreference row. or inserts it if new.
 void update(NotifPreferenceRow notifPreference)
          Update the given NotifPreferenceRow
 
Methods inherited from class com.stratelia.webactiv.util.AbstractTable
aliasColumns, getInteger, getInteger, getMatchingRows, getNextId, getRows, getRows, getRows, getRows, getRows, getRows, getRows, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, insertRow, truncate, updateRelation, updateRelation, updateRow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOTIFPREFERENCE_COLUMNS

protected static final String NOTIFPREFERENCE_COLUMNS
The column list used for every select query.

See Also:
Constant Field Values
Constructor Detail

NotifPreferenceTable

public NotifPreferenceTable(Schema schema)
Builds a new NotifPreferenceTable

Method Detail

getNotifPreference

public NotifPreferenceRow getNotifPreference(int id)
                                      throws UtilException
Returns the unique NotifPreference row having a given id

Throws:
UtilException

getByUserIdAndComponentInstanceIdAndMessageType

public NotifPreferenceRow getByUserIdAndComponentInstanceIdAndMessageType(int userId,
                                                                          int componentInstanceId,
                                                                          int messageType)
                                                                   throws UtilException
Returns the unique NotifPreference row having the given userId,componentInstanceId,messageType

Throws:
UtilException

getAllByComponentInstanceId

public NotifPreferenceRow[] getAllByComponentInstanceId(int componentInstanceId)
                                                 throws UtilException
Returns all the NotifPreferenceRow having a given componentInstanceId

Throws:
UtilException

getAllByUserId

public NotifPreferenceRow[] getAllByUserId(int userId)
                                    throws UtilException
Returns all the NotifPreferenceRow having a given userId

Throws:
UtilException

getAllRows

public NotifPreferenceRow[] getAllRows()
                                throws UtilException
Returns all the rows.

Throws:
UtilException

getNotifPreference

public NotifPreferenceRow getNotifPreference(String query)
                                      throws UtilException
Returns the unique row given by a no parameters query.

Throws:
UtilException

getNotifPreferences

public NotifPreferenceRow[] getNotifPreferences(String query)
                                         throws UtilException
Returns all the rows given by a no parameters query.

Throws:
UtilException

create

public int create(NotifPreferenceRow notifPreference)
           throws UtilException
Inserts in the database a new NotifPreference row.

Throws:
UtilException

update

public void update(NotifPreferenceRow notifPreference)
            throws UtilException
Update the given NotifPreferenceRow

Throws:
UtilException

save

public void save(NotifPreferenceRow notifPreference)
          throws UtilException
Updates theNotifPreference row. or inserts it if new.

Throws:
UtilException

delete

public void delete(int id)
            throws UtilException
Deletes theNotifPreferenceRow. after having removed all the reference to it.

Throws:
UtilException

dereferenceComponentInstanceId

public void dereferenceComponentInstanceId(int componentInstanceId)
                                    throws UtilException
Removes a reference to ComponentInstanceId

Throws:
UtilException

dereferenceUserId

public void dereferenceUserId(int userId)
                       throws UtilException
Removes a reference to UserId

Throws:
UtilException

fetchRow

protected NotifPreferenceRow fetchRow(ResultSet rs)
                               throws SQLException
Fetch the current NotifPreference row from a resultSet.

Specified by:
fetchRow in class AbstractTable<NotifPreferenceRow>
Throws:
SQLException

prepareUpdate

protected void prepareUpdate(String updateQuery,
                             PreparedStatement update,
                             NotifPreferenceRow r)
                      throws SQLException
Prepares the statement to update the given row

Specified by:
prepareUpdate in class AbstractTable<NotifPreferenceRow>
Throws:
SQLException

prepareInsert

protected void prepareInsert(String insertQuery,
                             PreparedStatement insert,
                             NotifPreferenceRow r)
                      throws SQLException
Prepares the statement to insert the given row

Specified by:
prepareInsert in class AbstractTable<NotifPreferenceRow>
Throws:
SQLException


Copyright © 2016 Silverpeas. All Rights Reserved.