|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.root.db.PersisterAdapter
public abstract class PersisterAdapter
An abstract persister adapter.
| Constructor Summary | |
|---|---|
PersisterAdapter(String key,
Object adapt,
MBeanReference pbf)
Constructs a new persister with an adaptee and an MBean server. |
|
PersisterAdapter(String key,
Object adapt,
Principal princ,
MBeanReference ref)
Constructs a new persister with an adaptee, principal and an MBean server. |
|
| Method Summary | |
|---|---|
void |
abortTransaction()
Aborts a transaction to cancel updates to the repository. |
void |
beginTransaction()
Begins a transaction to start updates in the repository. |
DBQuery |
buildQuery(String className,
DBCriteria criteria,
boolean distinct)
Builds a query to a specified criteria for the named class. |
DBQuery |
buildQuery(String className,
String[] attributes,
DBCriteria criteria,
boolean distinct)
Builds a query to a specified criteria for the named class returning only selected attributes. |
DBQuery |
buildQuery(String className,
String expr,
boolean sql)
Builds a query to a query language expression for the named class. |
void |
clearCache()
Clears the cache associated to this persister, if any. |
void |
close()
Closes the connection to the repository. |
void |
commitTransaction()
Commits a transaction to complete updates in the repository. |
void |
deleteObjects(Class clazz,
DBCriteria criteria)
Deletes objects of the specified criteria and class as one transaction. |
void |
deleteObjects(Class clazz,
String attribute,
Object value,
int condition)
Deletes objects of the specified class from the repository as one transaction. |
void |
deleteObjects(String className,
DBCriteria criteria)
Deletes objects of the specified criteria and named class as one transaction. |
void |
deleteObjects(String className,
String attribute,
Object value,
int condition)
Deletes objects of the named class from the repository as one transaction. |
void |
dump(Collection objects,
File file)
Dumps a objects into a dump file if this persister supports files. |
Object |
getAdaptee()
Gets the implementation specific persister adaptee, if any. |
String |
getConnectionKey()
Gets the connection key bound to this persister. |
String |
getKeyAttribute(Class clazz)
Gets the primary key attribute of the specified class. |
String |
getKeyAttribute(String className)
Gets the primary key attribute of the named class. |
String[] |
getKeyAttributes(Class clazz)
Gets the primary key attributes of the specified class. |
String[] |
getKeyAttributes(String className)
Gets the primary key attributes of the named class. |
Locale |
getLocale()
Gets the locale of this persister. |
protected Object |
getMBeanReferent(Object object)
Gets the referent of an MBean reference. |
MBeanServer |
getMBeanServer()
Gets the MBean server of this persister. |
protected PersisterFactory |
getPersisterFactory()
Gets the persister factory. |
Principal |
getPrincipal()
Gets the principal of this persister. |
String |
getRepository(String className)
Gets the name of the repository of the named class. |
boolean |
isClosed()
Checks whether this persister is closed. |
boolean |
isInTransaction()
Checks whether this persister is performing a transaction. |
boolean |
isPersistentAttribute(Class clazz,
String field)
Checks whether an attribute of the specified class is persistent. |
boolean |
isPersistentAttribute(String className,
String field)
Checks whether an attribute of the named class is persistent. |
boolean |
isTransactionsSupported()
Checks whether this persister implementation supports transactions. |
Collection |
load(File file)
Loads objects from a dump file if this persister supports files. |
protected void |
modified()
Notifies the persister factory about modifications. |
Object |
queryBySample(Object identity)
Queries an object by its properties or identity. |
int |
queryCount(Class clazz,
DBCriteria criteria)
Queries the count of objects of the specified criteria and class. |
int |
queryCount(Class clazz,
String attribute,
Object value,
int condition)
Queries the count of objects of the specified class. |
int |
queryCount(String className,
DBCriteria criteria)
Queries the count of objects of the specified criteria and named class. |
int |
queryCount(String className,
String attribute,
Object value,
int condition)
Queries the count of objects of the named class. |
QueryIterator |
queryIterator(Class clazz,
DBCriteria criteria)
Queries an iterator to a collection of objects of the specified criteria and class. |
QueryIterator |
queryIterator(Class clazz,
String attribute,
Object value,
int condition)
Queries an iterator to a collection of objects of the specified class. |
QueryIterator |
queryIterator(String className,
DBCriteria criteria)
Queries an iterator to a collection of objects of the specified criteria and named class. |
QueryIterator |
queryIterator(String className,
String attribute,
Object value,
int condition)
Queries an iterator to a collection of objects of the named class. |
Object |
queryObject(Class clazz,
Object value)
Queries an object of the specified class. |
Object |
queryObject(Class clazz,
String attribute,
Object value)
Queries an object of the specified class with the named attribute. |
Object |
queryObject(String className,
Object value)
Queries an object of the named class. |
Object |
queryObject(String className,
String attribute,
Object value)
Queries an object of the named class with the named attribute. |
Collection |
queryObjects(Class clazz,
DBCriteria criteria)
Queries objects of the specified criteria and class. |
Collection |
queryObjects(Class clazz,
String attribute,
Object value,
int condition)
Queries objects of the specified class. |
Collection |
queryObjects(String className,
DBCriteria criteria)
Queries objects of the specified criteria and named class. |
Collection |
queryObjects(String className,
String attribute,
Object value,
int condition)
Queries objects of the named class. |
void |
refreshReference(Object object,
String name,
boolean force)
Refreshes a named reference of the specified object. |
void |
refreshReferences(Object object,
boolean force)
Refreshes references of the specified object. |
void |
removeFromCache(Object object)
Removes the specified object from the cache. |
void |
setLocale(Locale loc)
Sets the locale of this persister. |
protected Class |
toClass(String className)
Returns the class instance of the named class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.root.db.Persister |
|---|
buildQuery, buildQuery, buildQuery, buildQuery, deleteObject, deleteObjects, deleteObjects, getCriteria, getCriteria, insertObject, insertObjects, queryCount, queryIterator, queryObject, queryObjects, storeObject, storeObjects, toIdentity, updateObject, updateObjects |
| Constructor Detail |
|---|
public PersisterAdapter(String key,
Object adapt,
MBeanReference pbf)
key - the connector key.adapt - the persister adaptee.pbf - the persister factory.
NullPointerException - if key is null.
public PersisterAdapter(String key,
Object adapt,
Principal princ,
MBeanReference ref)
key - the connector key.adapt - the persister adaptee.princ - the principal.ref - the persister factory.
NullPointerException - if key is null.| Method Detail |
|---|
public String getConnectionKey()
Persister
getConnectionKey in interface Persisterpublic Object getAdaptee()
Persister
getAdaptee in interface Persisterpublic void close()
Persister
close in interface Persisterpublic boolean isClosed()
Persister
isClosed in interface Persisterpublic void clearCache()
Persister
clearCache in interface Persisterpublic void removeFromCache(Object object)
Persister
removeFromCache in interface Persisterobject - the object.
public void refreshReferences(Object object,
boolean force)
Persister
refreshReferences in interface Persisterobject - the object.force - force the refresh if true, otherwise false.
public void refreshReference(Object object,
String name,
boolean force)
Persister
refreshReference in interface Persisterobject - the object.name - the reference attribute.force - force the refresh if true, otherwise false.public String getKeyAttribute(Class clazz)
Persister
getKeyAttribute in interface Persisterclazz - the class.
public String getKeyAttribute(String className)
Persister
getKeyAttribute in interface PersisterclassName - the class name.
public String[] getKeyAttributes(Class clazz)
Persister
getKeyAttributes in interface Persisterclazz - the class.
public String[] getKeyAttributes(String className)
Persister
getKeyAttributes in interface PersisterclassName - the class name.
public boolean isPersistentAttribute(Class clazz,
String field)
Persister
isPersistentAttribute in interface Persisterclazz - the class.field - the field.
public boolean isPersistentAttribute(String className,
String field)
Persister
isPersistentAttribute in interface PersisterclassName - the class name.field - the field.
public DBQuery buildQuery(String className,
String expr,
boolean sql)
Persister
buildQuery in interface PersisterclassName - the class name to query.expr - the query expression.sql - the SQL flag.
public DBQuery buildQuery(String className,
DBCriteria criteria,
boolean distinct)
Persister
buildQuery in interface PersisterclassName - the class name to query.criteria - an implementation specific criteria.distinct - a flag to indicate a distinct query.
public DBQuery buildQuery(String className,
String[] attributes,
DBCriteria criteria,
boolean distinct)
Persister
buildQuery in interface PersisterclassName - the class name to query.attributes - the attributes to return.criteria - in implementation specific criteria.distinct - a flag to indicate a distinct query.
public Object queryBySample(Object identity)
throws PersisterException
Persister
queryBySample in interface Persisteridentity - the sample object of identity.
PersisterException - on errors.
public Object queryObject(Class clazz,
Object value)
throws PersisterException
Persister
queryObject in interface Persisterclazz - the class to query.value - the PK of the object.
PersisterException - on errors.
public Object queryObject(String className,
Object value)
throws PersisterException
Persister
queryObject in interface PersisterclassName - the class name to query.value - the PK of the object.
PersisterException - on errors.
public Object queryObject(Class clazz,
String attribute,
Object value)
throws PersisterException
Persister
queryObject in interface Persisterclazz - the class to query.attribute - the name of the attribute.value - the value of the attribute.
PersisterException - on errors.
public Object queryObject(String className,
String attribute,
Object value)
throws PersisterException
Persister
queryObject in interface PersisterclassName - the class name to query.attribute - the name of the attribute.value - the value of the attribute.
PersisterException - on errors.
public Collection queryObjects(Class clazz,
DBCriteria criteria)
throws PersisterException
Persister
queryObjects in interface Persisterclazz - the class to query.criteria - the criteria to apply.
PersisterException - on errors.
public Collection queryObjects(String className,
DBCriteria criteria)
throws PersisterException
Persister
queryObjects in interface PersisterclassName - the class name to query.criteria - the criteria to apply.
PersisterException - on errors.
public Collection queryObjects(Class clazz,
String attribute,
Object value,
int condition)
throws PersisterException
Persister
queryObjects in interface Persisterclazz - the class to query.attribute - the name of the attribute.value - the value of the attribute.condition - the condition for the criteria.
PersisterException - on errors.
public Collection queryObjects(String className,
String attribute,
Object value,
int condition)
throws PersisterException
Persister
queryObjects in interface PersisterclassName - the class name to query.attribute - the name of the attribute.value - the value of the attribute.condition - the condition for the criteria.
PersisterException - on errors.
public QueryIterator queryIterator(Class clazz,
DBCriteria criteria)
throws PersisterException
Persister
queryIterator in interface Persisterclazz - the class to query.criteria - the criteria to apply.
PersisterException - on errors.
public QueryIterator queryIterator(String className,
DBCriteria criteria)
throws PersisterException
Persister
queryIterator in interface PersisterclassName - the class name to query.criteria - the criteria to apply.
PersisterException - on errors.
public QueryIterator queryIterator(Class clazz,
String attribute,
Object value,
int condition)
throws PersisterException
Persister
queryIterator in interface Persisterclazz - the class to query.attribute - the name of the attribute.value - the value of the attribute.condition - the condition for the criteria.
PersisterException - on errors.
public QueryIterator queryIterator(String className,
String attribute,
Object value,
int condition)
throws PersisterException
Persister
queryIterator in interface PersisterclassName - the class name to query.attribute - the name of the attribute.value - the value of the attribute.condition - the condition for the criterion attribute.
PersisterException - on errors.
public int queryCount(Class clazz,
DBCriteria criteria)
Persister
queryCount in interface Persisterclazz - the class to query.criteria - the criteria to apply.
public int queryCount(String className,
DBCriteria criteria)
Persister
queryCount in interface PersisterclassName - the class name to query.criteria - the criteria to apply.
public int queryCount(Class clazz,
String attribute,
Object value,
int condition)
Persister
queryCount in interface Persisterclazz - the class to query.attribute - the name of the attribute.value - the value of the attribute.condition - the condition for the criteria.
public int queryCount(String className,
String attribute,
Object value,
int condition)
Persister
queryCount in interface PersisterclassName - the class name to query.attribute - the name of the attribute.value - the value of the attribute.condition - the condition for the criterion attribute.
public void deleteObjects(Class clazz,
DBCriteria criteria)
throws PersisterException
Persister
deleteObjects in interface Persisterclazz - the class to query.criteria - the criteria to apply.
PersisterException - on errors.
public void deleteObjects(String className,
DBCriteria criteria)
throws PersisterException
Persister
deleteObjects in interface PersisterclassName - the class name to query.criteria - the criteria to apply.
PersisterException - on errors.
public void deleteObjects(Class clazz,
String attribute,
Object value,
int condition)
throws PersisterException
Persister
deleteObjects in interface Persisterclazz - the class to delete.attribute - the name of the attribute.value - the value of the attribute.condition - the condition for the criteria.
PersisterException - on errors.
public void deleteObjects(String className,
String attribute,
Object value,
int condition)
throws PersisterException
Persister
deleteObjects in interface PersisterclassName - the class name to delete.attribute - the name of the attribute.value - the value of the attribute.condition - the condition for the criteria.
PersisterException - on errors.public boolean isTransactionsSupported()
Persister
isTransactionsSupported in interface Persisterpublic boolean isInTransaction()
Persister
isInTransaction in interface Persisterpublic void beginTransaction()
PersisterNo-op if transactions are not supported.
beginTransaction in interface Persisterpublic void abortTransaction()
PersisterNo-op if transactions are not supported.
abortTransaction in interface Persisterpublic void commitTransaction()
PersisterNo-op if transactions are not supported.
commitTransaction in interface Persisterpublic String getRepository(String className)
Persister
getRepository in interface PersisterclassName - the class name.
public Collection load(File file)
throws PersisterException
Persister
load in interface Persisterfile - the dump file.
PersisterException - for loading errors.
public void dump(Collection objects,
File file)
throws PersisterException
Persister
dump in interface Persisterobjects - a collection of objects to dump.file - the dump file.
PersisterException - for dumping errors.public Locale getLocale()
Persister
getLocale in interface Persisterpublic void setLocale(Locale loc)
Persister
setLocale in interface Persisterloc - the locale.public Principal getPrincipal()
Persister
getPrincipal in interface Persisterpublic MBeanServer getMBeanServer()
Persister
getMBeanServer in interface Persisterprotected PersisterFactory getPersisterFactory()
protected Object getMBeanReferent(Object object)
object - the reference.
protected void modified()
protected Class toClass(String className)
throws ClassNotFoundException
className - the class name to load.
ClassNotFoundException - if the loading fails.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||