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

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

public class JDBCStringTray
extends java.lang.Object
implements ConcreteTray

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

Since:
12-8-2000
Author:
David Walend

Field Summary
static java.lang.String STRINGPROPKEY
           
 
Fields inherited from interface net.walend.lyophil.Tray
TRAY
 
Constructor Summary
JDBCStringTray()
           
 
Method Summary
protected  java.lang.Long castIdentifier(java.io.Serializable identifier)
           
 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.
 void freeze(Freezable object)
          Puts the Freezable in cold storage.
 Set getAllIdentifiersInTray()
          Get a Set containing all the identifiers in this Tray.
protected  java.lang.String getDatabaseName()
           
protected  java.lang.String getStringForID(java.io.Serializable id)
           
protected  PropertySource getStringPropertySource()
           
protected  JDBCTypableKeyTray getTypableKeyTray()
           
 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 throwOut(java.io.Serializable id)
          Remove a frozen instance from cold storage
 void updateOld(Freezable object)
          Update an old Freezable in the database.
 void validate(java.io.Serializable id, InvalidFrozenMap ifm)
          Validates identifier.
 void validateAll(InvalidFrozenMap ifm, Caster caster)
          Validates all the identifiers in the Caster.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRINGPROPKEY

public static final java.lang.String STRINGPROPKEY
Constructor Detail

JDBCStringTray

public JDBCStringTray()
Method Detail

getDatabaseName

protected java.lang.String getDatabaseName()

getStringPropertySource

protected PropertySource getStringPropertySource()

getTypableKeyTray

protected JDBCTypableKeyTray getTypableKeyTray()

castIdentifier

protected java.lang.Long castIdentifier(java.io.Serializable identifier)

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

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

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

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

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

validate

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

Specified by:
validate in interface Tray

validateAll

public void validateAll(InvalidFrozenMap ifm,
                        Caster caster)
Description copied from interface: Tray
Validates all the identifiers in the Caster.

Specified by:
validateAll in interface Tray

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

freeze

public void freeze(Freezable object)
Description copied from interface: ConcreteTray
Puts the Freezable in cold storage.

Specified by:
freeze in interface ConcreteTray

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

throwOut

public void throwOut(java.io.Serializable id)
              throws NotInFreezerException
Description copied from interface: ConcreteTray
Remove a frozen instance from cold storage

Specified by:
throwOut in interface ConcreteTray

getStringForID

protected java.lang.String getStringForID(java.io.Serializable id)

checkSetUp

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

Specified by:
checkSetUp in interface Tray

setUp

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

Specified by:
setUp in interface Tray

tearDown

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

Specified by:
tearDown in interface Tray


Copyright (c) 2000, 2001, David Walend