|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.davesag.generica.persistence.jdo.JdoArchivist
The JdoArchivist manages persistance for objects by delegating to a JDO PersistenceManager.
| Field Summary | |
protected javax.jdo.PersistenceManager |
thePersistenceManager
the hibernate session |
| Constructor Summary | |
JdoArchivist()
null constructor |
|
| Method Summary | |
void |
close()
Closes the PersistanceManager so it an no longer be used. |
void |
delete(Object o)
Delete the supplied object. |
boolean |
exists(Map fields,
String classname)
A fast test to determine if there is an object with values matching field names according to the supplied map. |
boolean |
exists(String namefield,
String name,
String classname)
A test to determine if there is an object with the given name, using the supplied namefield and classname as qualifiers of the search. |
void |
flush()
Does nothing. |
Object |
getDelegate()
Get the hibernate session to delegate to. |
Transaction |
getTransaction()
Return a Transaction that can be used to wrap atomic operations. |
Object |
load(Map fields,
String classname)
Load an object whose field values match the values keyed against those field names in the supplied Map. |
Object |
load(Object target,
Class clazz)
Load an object according to the target parameter supplied. |
Object |
load(String namefield,
String name,
String classname)
Convenience method to load an object with the given name, using the supplied namefield and classname as qualifiers of the search. |
protected javax.jdo.Query |
loadByUniqueStringQuery(String namefield,
String classname)
Build a Query from the named field and class for loading an
object or objects of that class where the namefield equals some value. |
Object |
save(Object o)
Save the supplied object. |
void |
setDelegate(Object delegate)
Set the hibernate session to delegate to. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected javax.jdo.PersistenceManager thePersistenceManager
| Constructor Detail |
public JdoArchivist()
| Method Detail |
public void setDelegate(Object delegate)
throws ClassCastException
setDelegate in interface Managerdelegate - The hibernate session to delegate to.
ClassCastException - if the deletaged object was not a valid
class hibernate session.public Object getDelegate()
getDelegate in interface Manager
public Object load(String namefield,
String name,
String classname)
throws ArchiveException
namefield:name pair are unique to this
class.
load in interface Archivistnamefield - The name of the property that holds the name to
against.name - The name The actual name we are looking for.classname - The fully qualified class of the object to load.
ArchiveException - if anything went wrong.loadByUniqueStringQuery(java.lang.String, java.lang.String)
public Object load(Map fields,
String classname)
throws ArchiveException
load in interface Archivistfields - The map of field valeus keyed against the field names
they corrospond with.classname - The fully qualified class of the object to load.
ArchiveException - if anything went wrong.
public Object load(Object target,
Class clazz)
throws ArchiveException
load in interface Archivisttarget - The target that informs the archivist as to which object
to load.clazz - the class to load
ArchiveException - if anything went wrong.
public Object save(Object o)
throws ArchiveException
save in interface Archivisto - the object to save.
ArchiveException - if anything went wrong.
public void delete(Object o)
throws ArchiveException
delete in interface Archivisto - the object to delete.
ArchiveException - if anything went wrong.
public boolean exists(String namefield,
String name,
String classname)
throws ArchiveException
load method to make sense.
exists in interface Archivistnamefield - The name of the bean property that holds the name to
test.name - The name The actual name we are looking for.classname - The fully qualified class of the persistable bean to
test for.
ArchiveException - if anything went wrong.
public boolean exists(Map fields,
String classname)
throws ArchiveException
load method to make sense. Load an object whose field values
match the values keyed against those field names in the supplied Map.
exists in interface Archivistfields - The map of field valeus keyed against the field names
they corrospond with.classname - The fully qualified class of the object to load.
ArchiveException - if anything went wrong.
public Transaction getTransaction()
throws ArchiveException
getTransaction in interface ArchivistArchiveException - if anything went wrong.
public void flush()
throws ArchiveException
flush in interface ArchivistArchiveException - never.
public void close()
throws ArchiveException
close in interface ArchivistArchiveException - if anything went wrong.
protected javax.jdo.Query loadByUniqueStringQuery(String namefield,
String classname)
Query from the named field and class for loading an
object or objects of that class where the namefield equals some value.
namefield - The name of the field to be matched against a string
value.classname - The name of the class to search for. Will search for
subclasses too.
Query q = loadByUniqueStringQuery("username", "org.davesag.generica.core.User");
(Collection) result = (Collection) q.execute("davesag");
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||