public class NotificationPrefController extends JDBCObjectController<NotificationPref>
NotificationPref
class. Provides methods
for retrieving and persisting user notification preference table records
in the database.Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
The class' serialization version id.
|
ivDBObjCls, ivFieldCount, ivFieldKeyAlt, ivFieldKeyPri, ivFieldResPfx, ivSyncLast, ivSyncType, ivTableName
ivHashCode, ivHashFlds, ivObjAttrs
Constructor and Description |
---|
NotificationPrefController()
The constructor for the controller.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.util.ArrayList<NotificationPref> prefs)
Adds a collection of new user notification preference records to the
database table.
|
int |
add(NotificationPref obj,
boolean logdup)
Adds a new record to the table associated with the controller.
|
boolean |
delete(NotificationPref obj)
Deletes an existing record from the table associated with the controller.
|
boolean |
deleteUser(java.lang.String id)
Deletes all user notification preference records from the database for the
given user id.
|
NotificationPref |
get(java.lang.String id,
java.lang.String type)
Returns the user notification preference for the given user id and message
type.
|
java.util.ArrayList<NotificationPref> |
getUser(java.lang.String id)
Returns a collection of user notification preference records for the given
user id.
|
java.util.ArrayList<NotificationPref> |
getUserDefaults(java.lang.String id,
java.lang.String type)
Returns the user notification preference defaults for the given user based
on the given user type (shopper, sales rep, admin, etc.).
|
java.util.ArrayList<NotificationPref> |
getUserDefaults(User user)
Returns the user notification preference defaults for the given user based
on the user's type (shopper, sales rep, admin, etc.).
|
boolean |
hasInterest(java.lang.String id,
java.lang.String type)
Answers if a user has interest in receiving notifications for a message
type.
|
boolean |
hasUser(java.lang.String id)
Answers if a given user id exists in the notification preference table.
|
boolean |
update(NotificationPref obj)
Updates an existing record in the table associated with the controller.
|
add, add, arrayToMap, arrayToMap, countAll, delete, deleteAll, dispose, equals, getAll, getConnection, getConnectionInfo, getController, getFieldNames, getFieldNamesForKey, getFieldNamesForUpdate, getFieldNulls, getFieldNullsForKey, getFieldNullsForUpdate, getFieldsForOrderBy, getFieldsForWhere, getFieldSize, getFieldTypes, getFieldTypesForKey, getFieldTypesForUpdate, getStatementForDelete, getStatementForGet, getStatementForGetAll, getStatementForInsert, getStatementForUpdate, getStatementKey, getStatementString, getTableName, hasFieldNamesForKey, hasFieldNamesForUpdate, isDuplicate, resultSetToArray, resultSetToMap, resultSetToMap, resultSetToObject, setConnectionInfo, setPSDeleteValues, setPSExistsValues, setPSInsertValues, setPSUpdateValues, setPSValue, update, valuesToObject
cloneMapAttributes, formatValue, formatValue, getHashFields, getMapArrayList, getMapAttributes, getMapBigDecimal, getMapBoolean, getMapDate, getMapDouble, getMapInteger, getMapLong, getMapMapped, getMapObject, getMapShort, getMapString, getMapString, getMapStringBuffer, getMapStringBuilder, getMapTime, getMapTimestamp, getMapVector, hashCode, setHashFields, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMapAttributes, setMapObject, setMapTime, setMapTimestamp, toStringArray
private static final long serialVersionUID
public NotificationPrefController()
public int add(NotificationPref obj, boolean logdup)
add
in JDBCObjectController
.add
in class JDBCObjectController<NotificationPref>
obj
- (JDBCObject) The object for the record to be added.logdup
- (boolean) true
if duplicate errors are to be
logged as an exception, otherwise false
if not. When
duplicates are logged, the return value of 1 is never returned.public boolean delete(NotificationPref obj)
delete
in class JDBCObjectController<NotificationPref>
obj
- (JDBCObject) The object for the record to be deleted.true
if the record deleted successfully,
otherwise false
.public boolean update(NotificationPref obj)
update
in class JDBCObjectController<NotificationPref>
obj
- (JDBCObject) The object for the record to be updated.true
if the record updated successfully,
otherwise false
.public boolean add(java.util.ArrayList<NotificationPref> prefs)
prefs
- (ArrayList) A collection of notification preferences
to be added.true
if the records added successfully,
otherwise false
.public boolean deleteUser(java.lang.String id)
id
- (String) The user id for the records to be deleted.true
if the records deleted successfully,
otherwise false
.public NotificationPref get(java.lang.String id, java.lang.String type)
id
- (String) The user id for the desired record.type
- (String) The message type for the desired record.public java.util.ArrayList<NotificationPref> getUser(java.lang.String id)
id
- (String) The user id for the desired records.public java.util.ArrayList<NotificationPref> getUserDefaults(User user)
user
- (User) The based-on user for the defaults.public java.util.ArrayList<NotificationPref> getUserDefaults(java.lang.String id, java.lang.String type)
id
- (String) The based-on user id for the defaults.type
- (String) The based-on user type for the defaults.public boolean hasUser(java.lang.String id)
id
- (String) The user id to check.true
if preferences exists, otherwise
false
.public boolean hasInterest(java.lang.String id, java.lang.String type)
id
- (String) The id for the user to check.type
- (String) The message type to check.true
if the user is interested,
otherwise false
.