Class NotifAddressTable
- java.lang.Object
-
- org.silverpeas.core.persistence.jdbc.AbstractTable<NotifAddressRow>
-
- org.silverpeas.core.notification.user.client.model.NotifAddressTable
-
@Repository public class NotifAddressTable extends AbstractTable<NotifAddressRow>
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
NOTIFADDRESS_COLUMNS
The column list used for every select query.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
create(NotifAddressRow notifAddress)
Inserts in the database a new NotifAddress row.void
delete(int id)
Deletes theNotifAddressRow. after having removed all the reference to it.void
deleteAndPropagate(int notifAddressId, int defaultAddress)
void
dereferenceNotifChannelId(int notifChannelId)
Removes a reference to NotifChannelIdvoid
dereferenceUserId(int userId)
Removes a reference to UserIdprotected NotifAddressRow
fetchRow(ResultSet rs)
Fetch the current NotifAddress row from a resultSet.NotifAddressRow[]
getAllByNotifChannelId(int notifChannelId)
Returns all the NotifAddressRow having a given notifChannelIdNotifAddressRow[]
getAllByUserId(int userId)
Returns all the NotifAddressRow having a given userIdNotifAddressRow[]
getAllRows()
Returns all the rows.NotifAddressRow
getNotifAddress(int id)
Returns the unique NotifAddress row having a given idNotifAddressRow
getNotifAddress(String query)
Returns the unique row given by a no parameters query.NotifAddressRow[]
getNotifAddresss(String query)
Returns all the rows given by a no parameters query.protected void
prepareInsert(String insertQuery, PreparedStatement insert, NotifAddressRow row)
Prepares the statement to insert the given rowprotected void
prepareUpdate(String updateQuery, PreparedStatement update, NotifAddressRow row)
Prepares the statement to update the given rowvoid
save(NotifAddressRow notifAddress)
Updates theNotifAddress row. or inserts it if new.void
update(NotifAddressRow notifAddress)
Update the given NotifAddressRow-
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
-
NOTIFADDRESS_COLUMNS
protected static final String NOTIFADDRESS_COLUMNS
The column list used for every select query.- See Also:
- Constant Field Values
-
-
Method Detail
-
getNotifAddress
public NotifAddressRow getNotifAddress(int id) throws SQLException
Returns the unique NotifAddress row having a given id- Throws:
SQLException
-
getAllByNotifChannelId
public NotifAddressRow[] getAllByNotifChannelId(int notifChannelId) throws SQLException
Returns all the NotifAddressRow having a given notifChannelId- Throws:
SQLException
-
getAllByUserId
public NotifAddressRow[] getAllByUserId(int userId) throws SQLException
Returns all the NotifAddressRow having a given userId- Throws:
SQLException
-
getAllRows
public NotifAddressRow[] getAllRows() throws SQLException
Returns all the rows.- Throws:
SQLException
-
getNotifAddress
public NotifAddressRow getNotifAddress(String query) throws SQLException
Returns the unique row given by a no parameters query.- Throws:
SQLException
-
getNotifAddresss
public NotifAddressRow[] getNotifAddresss(String query) throws SQLException
Returns all the rows given by a no parameters query.- Throws:
SQLException
-
create
public int create(NotifAddressRow notifAddress) throws SQLException
Inserts in the database a new NotifAddress row.- Throws:
SQLException
-
update
public void update(NotifAddressRow notifAddress) throws SQLException
Update the given NotifAddressRow- Throws:
SQLException
-
save
public void save(NotifAddressRow notifAddress) throws SQLException
Updates theNotifAddress row. or inserts it if new.- Throws:
SQLException
-
delete
public void delete(int id) throws SQLException
Deletes theNotifAddressRow. after having removed all the reference to it.- Throws:
SQLException
-
dereferenceNotifChannelId
public void dereferenceNotifChannelId(int notifChannelId) throws SQLException
Removes a reference to NotifChannelId- Throws:
SQLException
-
dereferenceUserId
public void dereferenceUserId(int userId) throws SQLException
Removes a reference to UserId- Throws:
SQLException
-
fetchRow
protected NotifAddressRow fetchRow(ResultSet rs) throws SQLException
Fetch the current NotifAddress row from a resultSet.- Specified by:
fetchRow
in classAbstractTable<NotifAddressRow>
- 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, NotifAddressRow row) throws SQLException
Prepares the statement to update the given row- Specified by:
prepareUpdate
in classAbstractTable<NotifAddressRow>
- Throws:
SQLException
-
prepareInsert
protected void prepareInsert(String insertQuery, PreparedStatement insert, NotifAddressRow row) throws SQLException
Prepares the statement to insert the given row- Specified by:
prepareInsert
in classAbstractTable<NotifAddressRow>
- Throws:
SQLException
-
deleteAndPropagate
public void deleteAndPropagate(int notifAddressId, int defaultAddress) throws SQLException
- Throws:
SQLException
-
-