|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.walend.lyophil.jdbc.JDBCCaster
This class implements a simple Caster for jdbc based systems.
Field Summary | |
protected MutableMap |
interfacesToWhereClauses
|
protected Map |
rolesToConcreteTrays
|
static java.lang.String |
SQLPROPERTYKEY
|
protected Map |
trayClassesToTrays
|
Fields inherited from interface net.walend.lyophil.Caster |
CASTER |
Constructor Summary | |
JDBCCaster()
|
Method Summary | |
boolean |
checkSetUp()
make sure the backing storage is set up correctly |
int |
count()
count the Freezables in the freezer. |
int |
countByClass(java.lang.Class interf)
Count the number of freezables that implement this interf. |
Set |
findByClass(java.lang.Class interf)
Returns the Set of Freezables in the Freezer that can be cast to interf. |
java.lang.Class |
findInterfaceForFreezable(Freezable freezable)
Returns the working interface for the freezable. |
private java.lang.Class |
findInterfaceForFreezableFromProperties(Freezable freezable)
|
java.lang.Class |
findInterfaceForIdentifier(java.io.Serializable id)
Returns the working interface for the object pointed at by identifier. |
protected ConcreteTray |
findTrayForIdentifier(java.io.Serializable id)
|
void |
freeze(Freezable freezable)
Add a freezable to the Caster's collection if it isn't already there. |
Set |
getAllIdentifiers()
Get a Set containing all the identifiers in the Freezer. |
protected PropertySource |
getCasterPropertySource()
|
protected java.lang.String |
getDatabaseName()
|
protected Mother |
getMother()
|
protected PropertySource |
getPropertySource()
|
protected ConcreteTray |
getTrayForFreezable(Freezable victem)
|
private ConcreteTray |
getTrayForIdentifier(java.io.Serializable id)
|
ConcreteTray |
getTrayForRole(java.lang.String role)
|
protected ConcreteTray |
getTrayForTrayClass(java.lang.Class trayClass)
|
protected java.lang.String |
getWhereClauseFor(java.lang.Class interf)
|
boolean |
isAbsent(java.io.Serializable id)
Return true if identifier is available in the frozen medium. |
boolean |
isPresent(java.io.Serializable id)
Return true if identifier is available in the frozen medium. |
void |
setUp()
set up the backing storage |
void |
tearDown()
clean up the backing storage |
Freezable |
thaw(java.io.Serializable id)
Thaw out a freezable. |
void |
throwOut(java.io.Serializable id)
Remove a freezable from the Caster's collection |
void |
validate(java.io.Serializable id,
InvalidFrozenMap ifm)
Validates identifier. |
void |
validateAll(InvalidFrozenMap ifm)
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 SQLPROPERTYKEY
protected Map rolesToConcreteTrays
protected Map trayClassesToTrays
protected MutableMap interfacesToWhereClauses
Constructor Detail |
public JDBCCaster()
Method Detail |
protected java.lang.String getDatabaseName()
protected PropertySource getPropertySource()
protected PropertySource getCasterPropertySource()
protected Mother getMother()
private ConcreteTray getTrayForIdentifier(java.io.Serializable id) throws NotInFreezerException
protected ConcreteTray getTrayForFreezable(Freezable victem)
public ConcreteTray getTrayForRole(java.lang.String role)
protected ConcreteTray getTrayForTrayClass(java.lang.Class trayClass)
public java.lang.Class findInterfaceForIdentifier(java.io.Serializable id) throws NotInFreezerException
Caster
findInterfaceForIdentifier
in interface Caster
private java.lang.Class findInterfaceForFreezableFromProperties(Freezable freezable)
public java.lang.Class findInterfaceForFreezable(Freezable freezable)
Caster
findInterfaceForFreezable
in interface Caster
public void freeze(Freezable freezable)
Caster
freeze
in interface Caster
public Freezable thaw(java.io.Serializable id) throws NotInFreezerException
Caster
thaw
in interface Caster
public void throwOut(java.io.Serializable id) throws NotInFreezerException
Caster
throwOut
in interface Caster
public void validate(java.io.Serializable id, InvalidFrozenMap ifm)
Caster
validate
in interface Caster
public void validateAll(InvalidFrozenMap ifm)
Caster
validateAll
in interface Caster
public boolean isAbsent(java.io.Serializable id)
Caster
isAbsent
in interface Caster
public boolean isPresent(java.io.Serializable id)
Caster
isPresent
in interface Caster
public Set getAllIdentifiers()
Caster
getAllIdentifiers
in interface Caster
public int count()
Caster
count
in interface Caster
protected java.lang.String getWhereClauseFor(java.lang.Class interf)
public int countByClass(java.lang.Class interf)
Caster
countByClass
in interface Caster
public Set findByClass(java.lang.Class interf)
Caster
findByClass
in interface Caster
public boolean checkSetUp()
Caster
checkSetUp
in interface Caster
public void setUp()
Caster
setUp
in interface Caster
public void tearDown()
Caster
tearDown
in interface Caster
protected ConcreteTray findTrayForIdentifier(java.io.Serializable id) throws NotInFreezerException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |