blackboard.persist.announcement
Interface AnnouncementDbPersister

All Superinterfaces:
Persister

public interface AnnouncementDbPersister
extends Persister

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

Nested Class Summary
static class AnnouncementDbPersister.Default
           
 
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 Announcement 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 Announcement identified by the given Id value using the supplied connection.
 void persist(Announcement announcement)
          Deprecated. Since 9.0. Use AnnouncementManager.save() instead. Saves the given announcement to the system, placing it at the top of the list of announcements for its context (ie, the course/org that it's created in, or the global announcement list if it's a system announcement). Some notes on usage:
  1. There is no way to specify a specific position for this announcement. It will always be placed at the top of the list.
  2. Course/org announcements will be registered with the notification system.
 void persist(Announcement announcement, java.sql.Connection con)
          Deprecated. Since 9.0. Use AnnouncementManager.save() instead. NOTE: The "con" parameter is no longer supported, and will be ignored. It uses the implicit context in all cases. Saves the given announcement to the system, placing it at the top of the list of announcements for its context (ie, the course/org that it's created in, or the global announcement list if it's a system announcement). Some notes on usage:
  1. There is no way to specify a specific position for this announcement. It will always be placed at the top of the list.
  2. Course/org announcements will be registered with the notification system.
 void persistSimple(Announcement announcement, java.sql.Connection con)
          Performs a simple persist of the given announcement; which is to say, it does not do any automatic reordering, nor does it register the announcement with Nautilus.
 void reposition(Id announcementId, int newPosition)
          A utility class that provides quick access to the AnnouncementDbPersister instance associated with the default instance of the database BbPersistenceManager.
 void reposition(Id announcementId, int newPosition, java.sql.Connection con)
          A utility class that provides quick access to the AnnouncementDbPersister instance from the database using the supplied connection.
 
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

@Deprecated
void persist(Announcement announcement)
             throws ValidationException,
                    PersistenceException
Deprecated. Since 9.0. Use AnnouncementManager.save() instead. Saves the given announcement to the system, placing it at the top of the list of announcements for its context (ie, the course/org that it's created in, or the global announcement list if it's a system announcement). Some notes on usage:
  1. There is no way to specify a specific position for this announcement. It will always be placed at the top of the list.
  2. Course/org announcements will be registered with the notification system.

Parameters:
announcement - The announcement to save
Throws:
ValidationException
PersistenceException

persist

@Deprecated
void persist(Announcement announcement,
                        java.sql.Connection con)
             throws ValidationException,
                    PersistenceException
Deprecated. Since 9.0. Use AnnouncementManager.save() instead. NOTE: The "con" parameter is no longer supported, and will be ignored. It uses the implicit context in all cases. Saves the given announcement to the system, placing it at the top of the list of announcements for its context (ie, the course/org that it's created in, or the global announcement list if it's a system announcement). Some notes on usage:
  1. There is no way to specify a specific position for this announcement. It will always be placed at the top of the list.
  2. Course/org announcements will be registered with the notification system.

Parameters:
announcement - The announcement to save
con - Db connection. No longer supported.
Throws:
ValidationException
PersistenceException

persistSimple

void persistSimple(Announcement announcement,
                   java.sql.Connection con)
                   throws ValidationException,
                          PersistenceException
Performs a simple persist of the given announcement; which is to say, it does not do any automatic reordering, nor does it register the announcement with Nautilus.

Parameters:
announcement - The announcement to save
con - The db connection to use. May be null.
Throws:
ValidationException
PersistenceException

deleteById

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

Throws:
KeyNotFoundException - is not thrown. Depending on the database used, if a matching Announcement does not exist a PersistenceException might be thrown or no exception will be thrown but no rows will be affected.
PersistenceException - if some other exception happens during the delete operation

deleteById

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

Throws:
KeyNotFoundException - is not thrown. Depending on the database used, if a matching Announcement does not exist a PersistenceException might be thrown or no exception will be thrown but no rows will be affected.
PersistenceException - if some other exception happens during the delete operation

reposition

void reposition(Id announcementId,
                int newPosition)
                throws KeyNotFoundException,
                       PersistenceException
A utility class that provides quick access to the AnnouncementDbPersister instance associated with the default instance of the database BbPersistenceManager.

This class and its method(s) are conveniences and should be used wisely. If one is retrieving many Loader and/or Persister instances within some scope, it will likely be more efficient to retrieve the default database persistence manager directly, and then retrieve loader/persister instances from it instead of making several calls to this and/or other loader/persister utility classes.

Throws:
KeyNotFoundException
PersistenceException

reposition

void reposition(Id announcementId,
                int newPosition,
                java.sql.Connection con)
                throws KeyNotFoundException,
                       PersistenceException
A utility class that provides quick access to the AnnouncementDbPersister instance from the database using the supplied connection.

This class and its method(s) are conveniences and should be used wisely. If one is retrieving many Loader and/or Persister instances within some scope, it will likely be more efficient to retrieve the default database persistence manager directly, and then retrieve loader/persister instances from it instead of making several calls to this and/or other loader/persister utility classes.

Throws:
KeyNotFoundException
PersistenceException


Copyright 2010 Blackboard, Inc. All Rights Reserved.