net.walend.lyophil.jdbc
Class JDBCTypableKeyTray

java.lang.Object
  |
  +--net.walend.lyophil.jdbc.JDBCTypableKeyTray
All Implemented Interfaces:
Tray

public class JDBCTypableKeyTray
extends java.lang.Object
implements Tray

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:
2001-04-05
Author:
David Walend

Field Summary
static java.lang.String JDBCTYPABLEKEYTRAY
           
 
Fields inherited from interface net.walend.lyophil.Tray
TRAY
 
Constructor Summary
JDBCTypableKeyTray()
           
 
Method Summary
protected  java.lang.Long castIdentifier(java.io.Serializable identifier)
           
 boolean checkSetUp()
          make sure the backing storage is set up correctly
 boolean containsTypableKey(java.lang.String key)
           
 void delete(java.io.Serializable id)
          Remove everything about this id from the Tray.
 java.io.Serializable findByTypableKey(java.lang.String key)
           
 Set getAllIdentifiersInTray()
          Get a Set containing all the identifiers in this Tray.
protected  java.lang.String getDatabaseName()
           
protected  PropertySource getTrayPropertySource()
           
 java.lang.String getTypableKeyForFreezable(java.io.Serializable identifier)
           
 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
 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

JDBCTYPABLEKEYTRAY

public static final java.lang.String JDBCTYPABLEKEYTRAY
Constructor Detail

JDBCTypableKeyTray

public JDBCTypableKeyTray()
Method Detail

getDatabaseName

protected java.lang.String getDatabaseName()

getTrayPropertySource

protected PropertySource getTrayPropertySource()

castIdentifier

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

findByTypableKey

public java.io.Serializable findByTypableKey(java.lang.String key)
                                      throws NotInFreezerException

containsTypableKey

public boolean containsTypableKey(java.lang.String key)

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)
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)
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

getTypableKeyForFreezable

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

validate

public void validate(java.io.Serializable id,
                     InvalidFrozenMap ifm)
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

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