blackboard.persist.discussionboard
Interface MessageDbPersister

All Superinterfaces:
Persister

public interface MessageDbPersister
extends Persister

This interface describes the set of methods that all database persisters for Message 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.

Since:
Bb 5.5
Version:
$Revision: #1 $ $Date: 2007/06/27 $

Nested Class Summary
static class MessageDbPersister.Default
          A utility class that provides quick access to the MessageDbPersister 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 deleteByForumId(Id forumId)
          Deletes the Messages in the Forum with the given Id value using a connection from the associated persistence manager's database container.
 void deleteByForumId(Id forumId, java.sql.Connection con)
          Deletes the Messages in the Forum with the given Id value using the supplied connection.
 void deleteById(Id id)
          Deletes the Message 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 Message identified by the given Id value using the supplied connection.
 void persist(Message message)
          Inserts or updates the supplied Message using a connection from the associated persistence manager's database container.
 void persist(Message message, java.sql.Connection con)
          Inserts or updates the supplied Message using the supplied connection.
 void saveMessageHitCount(Message msg)
          Update the message hit count
 void saveMessageHitCount(Message msg, java.sql.Connection con)
          Update the message hit count
 void saveMessageLifeCycleAndThreadLock(Message msg)
          Update the message life cycle
 void saveMessageLifeCycleAndThreadLock(Message msg, java.sql.Connection con)
          Update the message life cycle
 
Methods inherited from interface blackboard.persist.Persister
getAppVersion, init
 

Field Detail

TYPE

static final java.lang.String TYPE
Type used to obtain an instance of the class configured to provide the implementation for this interface. Used when making a call to BbPersistenceManager.getPersister(String)

See Also:
Constant Field Values
Method Detail

persist

void persist(Message message)
             throws ValidationException,
                    PersistenceException
Inserts or updates the supplied Message 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.

Throws:
ValidationException - if the object is not in a consistent state to be persisted.
PersistenceException - if some other exception happens while persisting the object.

persist

void persist(Message message,
             java.sql.Connection con)
             throws ValidationException,
                    PersistenceException
Inserts or updates the supplied Message 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.

Throws:
ValidationException - if the object is not in a consistent state to be persisted.
PersistenceException - if some other exception happens while persisting the object.

deleteById

void deleteById(Id id)
                throws KeyNotFoundException,
                       PersistenceException
Deletes the Message identified by the given Id value using a connection from the associated persistence manager's database container.

Throws:
KeyNotFoundException - if an object with the given Id value can not be found
PersistenceException - if some other exception happens during the delete operation

deleteById

void deleteById(Id id,
                java.sql.Connection con)
                throws KeyNotFoundException,
                       PersistenceException
Deletes the Message identified by the given Id value using the supplied connection.

Throws:
KeyNotFoundException - if an object with the given Id value can not be found
PersistenceException - if some other exception happens during the delete operation

deleteByForumId

void deleteByForumId(Id forumId)
                     throws KeyNotFoundException,
                            PersistenceException
Deletes the Messages in the Forum with the given Id value using a connection from the associated persistence manager's database container.

Throws:
KeyNotFoundException - if an object with the given Id value can not be found
PersistenceException - if some other exception happens during the delete operation

deleteByForumId

void deleteByForumId(Id forumId,
                     java.sql.Connection con)
                     throws KeyNotFoundException,
                            PersistenceException
Deletes the Messages in the Forum with the given Id value using the supplied connection.

Throws:
KeyNotFoundException - if an object with the given Id value can not be found
PersistenceException - if some other exception happens during the delete operation

saveMessageLifeCycleAndThreadLock

void saveMessageLifeCycleAndThreadLock(Message msg,
                                       java.sql.Connection con)
                                       throws ValidationException,
                                              PersistenceException
Update the message life cycle

Parameters:
msg -
con -
Throws:
ValidationException
PersistenceException

saveMessageLifeCycleAndThreadLock

void saveMessageLifeCycleAndThreadLock(Message msg)
                                       throws ValidationException,
                                              PersistenceException
Update the message life cycle

Parameters:
msg -
Throws:
ValidationException
PersistenceException

saveMessageHitCount

void saveMessageHitCount(Message msg)
                         throws ValidationException,
                                PersistenceException
Update the message hit count

Parameters:
msg -
Throws:
ValidationException
PersistenceException

saveMessageHitCount

void saveMessageHitCount(Message msg,
                         java.sql.Connection con)
                         throws ValidationException,
                                PersistenceException
Update the message hit count

Parameters:
msg -
con -
Throws:
ValidationException
PersistenceException


Copyright © 2003 Blackboard, Inc. All Rights Reserved.