net.walend.lyophil.jdbc.test.stringbean
Class JDBCColorStringTray

java.lang.Object
  |
  +--net.walend.lyophil.jdbc.test.stringbean.JDBCStringTray
        |
        +--net.walend.lyophil.jdbc.test.stringbean.JDBCColorStringTray
All Implemented Interfaces:
ConcreteTray, Tray

public class JDBCColorStringTray
extends JDBCStringTray

A simple backing for ColorStrings that uses the jdbc kit. A jdbc-based Freezer or a Frozen EJB for ColorStringBeans should use this class for database access.

Since:
1-15-2000
Author:
David Walend

Field Summary
static java.lang.String COLORPROPKEY
           
 
Fields inherited from class net.walend.lyophil.jdbc.test.stringbean.JDBCStringTray
STRINGPROPKEY
 
Fields inherited from interface net.walend.lyophil.Tray
TRAY
 
Constructor Summary
JDBCColorStringTray()
           
 
Method Summary
 boolean checkSetUp()
          make sure the backing storage is set up correctly
 void delete(java.io.Serializable id)
          Remove everything about this id from the Tray.
 Set getAllIdentifiersInTray()
          Get a Set containing all the identifiers in this Tray.
 java.lang.String getColorForID(java.io.Serializable identifier)
           
protected  PropertySource getColorStringPropertySource()
           
 void insertNew(Freezable object)
          Stick a new Freezable into the database.
 boolean isAbsent(java.io.Serializable id)
          For this tray only, is the id not represented by data? In most cases, this is simply !isPresent(id).
 boolean isPresent(java.io.Serializable ident)
          For this tray only, is the tray ready for data about this id?
 void setUp()
          Set up the backing storage
 void tearDown()
          clean up the backing storage
 Freezable thaw(java.io.Serializable id)
          Gets a Freezable out of cold storage.
 void updateOld(Freezable object)
          Update an old Freezable in the database.
 void validate(java.io.Serializable id, InvalidFrozenMap ifm)
          Validates identifier.
 
Methods inherited from class net.walend.lyophil.jdbc.test.stringbean.JDBCStringTray
castIdentifier, freeze, getDatabaseName, getStringForID, getStringPropertySource, getTypableKeyTray, throwOut, validateAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLORPROPKEY

public static final java.lang.String COLORPROPKEY
Constructor Detail

JDBCColorStringTray

public JDBCColorStringTray()
Method Detail

getColorStringPropertySource

protected PropertySource getColorStringPropertySource()

isPresent

public boolean isPresent(java.io.Serializable ident)
Description copied from interface: Tray
For this tray only, is the tray ready for data about this id?

Specified by:
isPresent in interface Tray
Overrides:
isPresent in class JDBCStringTray

isAbsent

public boolean isAbsent(java.io.Serializable id)
Description copied from interface: Tray
For this tray only, is the id not represented by data? In most cases, this is simply !isPresent(id). For empty sets, both can return true.

Specified by:
isAbsent in interface Tray
Overrides:
isAbsent in class JDBCStringTray

insertNew

public void insertNew(Freezable object)
Description copied from interface: Tray
Stick a new Freezable into the database. Don't look at it first to make sure it's not there.

Specified by:
insertNew in interface Tray
Overrides:
insertNew in class JDBCStringTray

updateOld

public void updateOld(Freezable object)
Description copied from interface: Tray
Update an old Freezable in the database. Don't look first to make sure that it's there.

Specified by:
updateOld in interface Tray
Overrides:
updateOld in class JDBCStringTray

delete

public void delete(java.io.Serializable id)
Description copied from interface: Tray
Remove everything about this id from the Tray.

A recursive method.

Specified by:
delete in interface Tray
Overrides:
delete in class JDBCStringTray

validate

public void validate(java.io.Serializable id,
                     InvalidFrozenMap ifm)
Description copied from interface: Tray
Validates identifier.

Specified by:
validate in interface Tray
Overrides:
validate in class JDBCStringTray

getAllIdentifiersInTray

public Set getAllIdentifiersInTray()
Description copied from interface: Tray
Get a Set containing all the identifiers in this Tray. It doesn't use the Freezables table.

Specified by:
getAllIdentifiersInTray in interface Tray
Overrides:
getAllIdentifiersInTray in class JDBCStringTray

thaw

public Freezable thaw(java.io.Serializable id)
               throws NotInFreezerException
Description copied from interface: ConcreteTray
Gets a Freezable out of cold storage. Normally, this should be a new instance of a previously frozen Freezable.

Specified by:
thaw in interface ConcreteTray
Overrides:
thaw in class JDBCStringTray

getColorForID

public java.lang.String getColorForID(java.io.Serializable identifier)

checkSetUp

public boolean checkSetUp()
Description copied from interface: Tray
make sure the backing storage is set up correctly

Specified by:
checkSetUp in interface Tray
Overrides:
checkSetUp in class JDBCStringTray

setUp

public void setUp()
Description copied from interface: Tray
Set up the backing storage

Specified by:
setUp in interface Tray
Overrides:
setUp in class JDBCStringTray

tearDown

public void tearDown()
Description copied from interface: Tray
clean up the backing storage

Specified by:
tearDown in interface Tray
Overrides:
tearDown in class JDBCStringTray


Copyright (c) 2000, 2001, David Walend