|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ContentDbPersister
This interface describes the set of methods that all database persisters for
Content
objects must implement.
A database persister allows an object to be stored (either inserted or updated)
within the database or to be deleted from the database. Persisting methods
are named according to the type of persistence that is performed.
Nested Class Summary | |
---|---|
static class |
ContentDbPersister.Default
A utility class that provides quick access to the ContentDbPersister
instance associated with the default instance of the database BbPersistenceManager . |
Field Summary | |
---|---|
static java.lang.String |
TYPE
Type used to obtain an instance of the class configured to provide the implementation for this interface. |
Method Summary | |
---|---|
void |
deleteById(Id id)
Deletes the Content identified by the given Id
value using a connection from the associated persistence manager's
database container. |
void |
deleteById(Id id,
java.sql.Connection con)
Deletes the Content identified by the given Id
value using the supplied connection. |
void |
markReviewed(Id contentId,
Id userId)
Marks the Content identified by the given contentId
value using a connection from the associated persistence manager's
database container as status "Reviewed" by the user identified by userId . |
void |
markReviewed(Id contentId,
Id userId,
java.util.Calendar reviewDate)
Marks the Content identified by the given contentId
value using a connection from the associated persistence manager's
database container as status "Reviewed" by the user identified by userId . |
void |
markReviewed(Id contentId,
Id userId,
java.util.Calendar reviewDate,
java.sql.Connection con)
Marks the Content identified by the given contentId
value using a connection from the associated persistence manager's
database container as status "Reviewed" by the user identified by userId . |
void |
markReviewed(Id contentId,
Id userId,
java.sql.Connection con)
Marks the Content identified by the given contentId
value using the supplied connection as status "Reviewed" by the user identified by userId . |
void |
markUnreviewed(Id contentId,
Id userId)
Marks the Content identified by the given contentId
value using the supplied connection as status "Not Reviewed" by the user identified by userId . |
void |
markUnreviewed(Id contentId,
Id userId,
java.sql.Connection con)
Marks the Content identified by the given contentId
value using the supplied connection as status "Not Reviewed" by the user identified by userId . |
void |
persist(Content target)
Inserts or updates the supplied Content using a
connection from the associated persistence manager's database container. |
void |
persist(Content target,
java.sql.Connection con)
Inserts or updates the supplied Content using the
supplied connection. |
void |
reposition(Id id,
int newPosition)
Used to dictate the new position that the Content item
should have using a connection from the associated persistence manager's
database container. |
void |
reposition(Id id,
int newPosition,
java.sql.Connection con)
Used to dictate the new position that the Content item
should have using the supplied connection. |
Methods inherited from interface blackboard.persist.Persister |
---|
getAppVersion, init |
Field Detail |
---|
static final java.lang.String TYPE
BbPersistenceManager.getPersister(String)
.
Method Detail |
---|
void persist(Content target) throws ValidationException, PersistenceException
Content
using a
connection from the associated persistence manager's database container.
If the object's Id is set and is associated with the same container, then
an update is done, otherwise a new object is inserted.
target
- Object to store.
ValidationException
- if the object is not in a consistent state
to be persisted.
PersistenceException
- if some other exception happens while
persisting the object.void persist(Content target, java.sql.Connection con) throws ValidationException, PersistenceException
Content
using the
supplied connection. The connection must be to the same database as is
used by the associated persistence manager. If the object's Id is set and
is associated with this persistence manager's same container, then an
update is done, otherwise a new object is inserted.
target
- Object to store.con
- Database connection to use. This may be null
ValidationException
- if the object is not in a consistent state
to be persisted.
PersistenceException
- if some other exception happens while
persisting the object.void deleteById(Id id) throws KeyNotFoundException, PersistenceException
Content
identified by the given Id
value using a connection from the associated persistence manager's
database container. Note that deletes are always "deep". That means that if
the object specified by id
is a folder or lesson, all contained
objects will also be deleted.
id
- Id of the object to delete.
KeyNotFoundException
- if an object with the given Id
value can not be found
PersistenceException
- if some other exception happens during the
delete operationvoid deleteById(Id id, java.sql.Connection con) throws KeyNotFoundException, PersistenceException
Content
identified by the given Id
value using the supplied connection. Note that deletes are always "deep".
That means that if the object specified by id
is a folder or lesson, all
contained objects will also be deleted.
id
- id of the object to deletecon
- Database connection to use. This may be null
KeyNotFoundException
- if an object with the given Id
value can not be found
PersistenceException
- if some other exception happens during the
delete operationvoid reposition(Id id, int newPosition) throws KeyNotFoundException, PersistenceException
Content
item
should have using a connection from the associated persistence manager's
database container.
id
- The Id of the Content Item to be repositionednewPosition
- An integer representing the new position
KeyNotFoundException
- if an object with the given Id
value can not be found
PersistenceException
void reposition(Id id, int newPosition, java.sql.Connection con) throws KeyNotFoundException, PersistenceException
Content
item
should have using the supplied connection.
id
- The Id of the Content Item to be repositionednewPosition
- An integer representing the new position
KeyNotFoundException
- if an object with the given Id
value can not be found
PersistenceException
void markReviewed(Id contentId, Id userId) throws PersistenceException, ValidationException
Content
identified by the given contentId
value using a connection from the associated persistence manager's
database container as status "Reviewed" by the user identified by userId
.
Marking an item "Reviewed" represents whether the user
has reviewed the Content Item.
contentId
- Id of the object to mark Reviewed.userId
- The id of the user that has Reviewed the item
PersistenceException
- if some other exception happens during the
operation
ValidationException
void markReviewed(Id contentId, Id userId, java.sql.Connection con) throws PersistenceException, ValidationException
Content
identified by the given contentId
value using the supplied connection as status "Reviewed" by the user identified by userId
.
Marking an item "Reviewed" represents whether the user
has reviewed the Content Item.
contentId
- Id of the object to mark Reviewed.userId
- The id of the user that has Reviewed the itemcon
-
PersistenceException
- if some other exception happens during the
operation
ValidationException
void markReviewed(Id contentId, Id userId, java.util.Calendar reviewDate) throws PersistenceException, ValidationException
Content
identified by the given contentId
value using a connection from the associated persistence manager's
database container as status "Reviewed" by the user identified by userId
.
This method allows the date for this action to be programatically set by specifying
reviewDate
.
contentId
- Id of the object to mark Reviewed.userId
- The id of the user that has Reviewed the itemreviewDate
- the Date that should be recorded
PersistenceException
- if some other exception happens during the
operation
ValidationException
void markReviewed(Id contentId, Id userId, java.util.Calendar reviewDate, java.sql.Connection con) throws PersistenceException, ValidationException
Content
identified by the given contentId
value using a connection from the associated persistence manager's
database container as status "Reviewed" by the user identified by userId
.
contentId
- Id of the object to mark UnReviewed.userId
- The id of the user that has Reviewed the itemreviewDate
- the Date that should be recorded
PersistenceException
- if some other exception happens during the
operation
ValidationException
void markUnreviewed(Id contentId, Id userId) throws PersistenceException, ValidationException
Content
identified by the given contentId
value using the supplied connection as status "Not Reviewed" by the user identified by userId
.
contentId
- Id of the object to mark UnReviewed.userId
- The id of the usercon
-
PersistenceException
- if some other exception happens during the
operation
ValidationException
void markUnreviewed(Id contentId, Id userId, java.sql.Connection con) throws PersistenceException, ValidationException
Content
identified by the given contentId
value using the supplied connection as status "Not Reviewed" by the user identified by userId
.
contentId
- Id of the object to mark Reviewed.userId
- The id of the usercon
-
PersistenceException
- if some other exception happens during the
operation
ValidationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |