|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.walend.collection.lyophil.jdbc.JDBCAoNMutableSetTray
A very simple backing for FreezableSets that uses the jdbc kit. A jdbc-based Freezer or a Frozen EJB for MutableSets can use this class for database access.
On freeze, this tray updates a database table with the set's contents. On thaw, it copies the contents in the database to the set.
Field Summary | |
static java.lang.String |
PROPKEY
|
Fields inherited from interface net.walend.lyophil.Tray |
TRAY |
Constructor Summary | |
JDBCAoNMutableSetTray()
|
Method Summary | |
private void |
addAllMembersToTable(java.io.Serializable id,
FreezableSet mutantSet)
|
private void |
addIdentifiersFromTable(java.io.Serializable id,
FreezableSet set)
|
private void |
addMemberToTable(java.io.Serializable id,
java.io.Serializable member)
|
protected java.lang.Long |
castIdentifier(java.io.Serializable identifier)
|
boolean |
checkSetUp()
make sure the backing storage is set up correctly |
protected void |
clearMemberTable(java.io.Serializable id)
|
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 PropertySource |
getPropertySource()
|
private Set |
identifierSetFromTable(java.io.Serializable id)
|
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 id)
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 identifier)
Gets a Freezable out of cold storage. |
void |
throwOut(java.io.Serializable identifier)
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 |
public static final java.lang.String PROPKEY
Constructor Detail |
public JDBCAoNMutableSetTray()
Method Detail |
protected PropertySource getPropertySource()
protected java.lang.String getDatabaseName()
protected java.lang.Long castIdentifier(java.io.Serializable identifier)
protected void clearMemberTable(java.io.Serializable id)
private void addMemberToTable(java.io.Serializable id, java.io.Serializable member)
private void addAllMembersToTable(java.io.Serializable id, FreezableSet mutantSet)
public boolean isPresent(java.io.Serializable id)
Tray
isPresent
in interface Tray
public boolean isAbsent(java.io.Serializable id)
Tray
isAbsent
in interface Tray
public void insertNew(Freezable object)
Tray
insertNew
in interface Tray
public void updateOld(Freezable object)
Tray
updateOld
in interface Tray
public void delete(java.io.Serializable id)
Tray
A recursive method.
delete
in interface Tray
public void validate(java.io.Serializable id, InvalidFrozenMap ifm)
Tray
validate
in interface Tray
public void validateAll(InvalidFrozenMap ifm, Caster caster)
Tray
validateAll
in interface Tray
public Set getAllIdentifiersInTray()
Tray
getAllIdentifiersInTray
in interface Tray
public void freeze(Freezable object)
ConcreteTray
freeze
in interface ConcreteTray
private Set identifierSetFromTable(java.io.Serializable id)
private void addIdentifiersFromTable(java.io.Serializable id, FreezableSet set)
public Freezable thaw(java.io.Serializable identifier)
ConcreteTray
thaw
in interface ConcreteTray
public void throwOut(java.io.Serializable identifier) throws NotInFreezerException
throwOut
in interface ConcreteTray
CannotThrowOutException
NotInFreezerException
public boolean checkSetUp()
Tray
checkSetUp
in interface Tray
public void setUp()
Tray
setUp
in interface Tray
public void tearDown()
Tray
tearDown
in interface Tray
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |