Class NotifPreferenceTable
- java.lang.Object
-
- org.silverpeas.core.persistence.jdbc.AbstractTable<NotifPreferenceRow>
-
- org.silverpeas.core.notification.user.client.model.NotifPreferenceTable
-
@Repository public class NotifPreferenceTable extends AbstractTable<NotifPreferenceRow>
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
NOTIFPREFERENCE_COLUMNS
The column list used for every select query.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 ComponentInstanceIdvoid
dereferenceUserId(int userId)
Removes a reference to UserIdprotected NotifPreferenceRow
fetchRow(ResultSet rs)
Fetch the current NotifPreference row from a resultSet.NotifPreferenceRow[]
getAllByComponentInstanceId(int componentInstanceId)
Returns all the NotifPreferenceRow having a given componentInstanceIdNotifPreferenceRow[]
getAllByUserId(int userId)
Returns all the NotifPreferenceRow having a given userIdNotifPreferenceRow[]
getAllRows()
Returns all the rows.NotifPreferenceRow
getByUserIdAndComponentInstanceIdAndMessageType(int userId, int componentInstanceId, int messageType)
Returns the unique NotifPreference row having the given userId,componentInstanceId,messageTypeNotifPreferenceRow
getNotifPreference(int id)
Returns the unique NotifPreference row having a given idNotifPreferenceRow
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 rowprotected void
prepareUpdate(String updateQuery, PreparedStatement update, NotifPreferenceRow r)
Prepares the statement to update the given rowvoid
save(NotifPreferenceRow notifPreference)
Updates theNotifPreference row. or inserts it if new.void
update(NotifPreferenceRow notifPreference)
Update the given NotifPreferenceRow-
Methods inherited from class org.silverpeas.core.persistence.jdbc.AbstractTable
getInteger, getInteger, getMatchingRows, getNextId, getRows, getRows, getRows, getRows, getRows, getRows, getRows, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, getUniqueRow, insertRow, truncate, updateRelation, updateRelation, updateRow
-
-
-
-
Field Detail
-
NOTIFPREFERENCE_COLUMNS
protected static final String NOTIFPREFERENCE_COLUMNS
The column list used for every select query.- See Also:
- Constant Field Values
-
-
Method Detail
-
getNotifPreference
public NotifPreferenceRow getNotifPreference(int id) throws SQLException
Returns the unique NotifPreference row having a given id- Throws:
SQLException
-
getByUserIdAndComponentInstanceIdAndMessageType
public NotifPreferenceRow getByUserIdAndComponentInstanceIdAndMessageType(int userId, int componentInstanceId, int messageType) throws SQLException
Returns the unique NotifPreference row having the given userId,componentInstanceId,messageType- Throws:
SQLException
-
getAllByComponentInstanceId
public NotifPreferenceRow[] getAllByComponentInstanceId(int componentInstanceId) throws SQLException
Returns all the NotifPreferenceRow having a given componentInstanceId- Throws:
SQLException
-
getAllByUserId
public NotifPreferenceRow[] getAllByUserId(int userId) throws SQLException
Returns all the NotifPreferenceRow having a given userId- Throws:
SQLException
-
getAllRows
public NotifPreferenceRow[] getAllRows() throws SQLException
Returns all the rows.- Throws:
SQLException
-
getNotifPreference
public NotifPreferenceRow getNotifPreference(String query) throws SQLException
Returns the unique row given by a no parameters query.- Throws:
SQLException
-
getNotifPreferences
public NotifPreferenceRow[] getNotifPreferences(String query) throws SQLException
Returns all the rows given by a no parameters query.- Throws:
SQLException
-
create
public int create(NotifPreferenceRow notifPreference) throws SQLException
Inserts in the database a new NotifPreference row.- Throws:
SQLException
-
update
public void update(NotifPreferenceRow notifPreference) throws SQLException
Update the given NotifPreferenceRow- Throws:
SQLException
-
save
public void save(NotifPreferenceRow notifPreference) throws SQLException
Updates theNotifPreference row. or inserts it if new.- Throws:
SQLException
-
delete
public void delete(int id) throws SQLException
Deletes theNotifPreferenceRow. after having removed all the reference to it.- Throws:
SQLException
-
dereferenceComponentInstanceId
public void dereferenceComponentInstanceId(int componentInstanceId) throws SQLException
Removes a reference to ComponentInstanceId- Throws:
SQLException
-
dereferenceUserId
public void dereferenceUserId(int userId) throws SQLException
Removes a reference to UserId- Throws:
SQLException
-
fetchRow
protected NotifPreferenceRow fetchRow(ResultSet rs) throws SQLException
Fetch the current NotifPreference row from a resultSet.- Specified by:
fetchRow
in classAbstractTable<NotifPreferenceRow>
- Parameters:
rs
- the result set from which the row will be fetched.- Returns:
- the entity in the row.
- Throws:
SQLException
- on SQL error.
-
prepareUpdate
protected void prepareUpdate(String updateQuery, PreparedStatement update, NotifPreferenceRow r) throws SQLException
Prepares the statement to update the given row- Specified by:
prepareUpdate
in classAbstractTable<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 classAbstractTable<NotifPreferenceRow>
- Throws:
SQLException
-
-