|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.root.db.PersisterAdapter
org.norther.tammi.root.castor.XMLPersister
public class XMLPersister
XML specific implementation of Persister.
| Constructor Summary | |
|---|---|
XMLPersister(String key,
Repository repo,
Principal princ,
MBeanReference pbf)
Constructs a new persister. |
|
| 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(Class clazz,
DBCriteria criteria,
boolean distinct)
Builds a query to a specified criteria for the specified class. |
DBQuery |
buildQuery(Class clazz,
String[] attributes,
DBCriteria criteria,
boolean distinct)
Builds a query to a specified criteria for the specified class returning only selected attributes. |
DBQuery |
buildQuery(Class clazz,
String expr,
boolean sql)
Builds a query to a query language expression for the specified class. |
DBQuery |
buildQuery(Object sample)
Builds a query to a sample object, an identity or a specific class. |
void |
close()
Closes the connection to the repository. |
void |
commitTransaction()
Commits a transaction to complete updates in the repository. |
void |
deleteObject(Object object)
Deletes an object from the repository. |
void |
deleteObjects(Collection objects)
Deletes a collection of objects from the repository as one transaction. |
void |
deleteObjects(DBQuery query)
Deletes query objects from the repository as one transaction. |
void |
dump(Collection objects,
File file)
Dumps a objects into a dump file if this persister supports files. |
DBCriteria |
getCriteria()
Gets implementation specific criteria. |
DBCriteria |
getCriteria(Object criteria)
Gets initialized implementation specific criteria. |
String |
getKeyAttribute(String className)
Gets the primary key attribute of the named class. |
String[] |
getKeyAttributes(String className)
Gets the primary key attributes of the named class. |
String |
getRepository(String className)
Gets the name of the repository of the named class. |
void |
insertObject(Object object)
Inserts an object to the repository. |
void |
insertObjects(Collection objects)
Inserts a collection of objects to the repository as one transaction. |
boolean |
isInTransaction()
Checks whether this persister is performing a transaction. |
boolean |
isTransactionsSupported()
Checks whether this persister implementation supports transactions. |
Collection |
load(File file)
Loads objects from a dump file if this persister supports files. |
int |
queryCount(DBQuery query)
Queries the count of objects the given query would return. |
QueryIterator |
queryIterator(DBQuery query)
Queries an iterator to a collection of objects. |
Object |
queryObject(DBQuery query)
Queries an object. |
Collection |
queryObjects(DBQuery query)
Queries objects. |
void |
storeObject(Object object)
Stores an object to the repository. |
void |
storeObjects(Collection objects)
Stores a collection of objects to the repository as one transaction. |
Object |
toIdentity(Object sample)
Returns an implementation specific object representing the identity of the specified sample object. |
void |
updateObject(Object object)
Updates an object in the repository. |
void |
updateObjects(Collection objects)
Updates a collection of objects in the repository as one transaction. |
| Methods inherited from class org.norther.tammi.root.db.PersisterAdapter |
|---|
buildQuery, buildQuery, buildQuery, clearCache, deleteObjects, deleteObjects, deleteObjects, deleteObjects, getAdaptee, getConnectionKey, getKeyAttribute, getKeyAttributes, getLocale, getMBeanReferent, getMBeanServer, getPersisterFactory, getPrincipal, isClosed, isPersistentAttribute, isPersistentAttribute, modified, queryBySample, queryCount, queryCount, queryCount, queryCount, queryIterator, queryIterator, queryIterator, queryIterator, queryObject, queryObject, queryObject, queryObject, queryObjects, queryObjects, queryObjects, queryObjects, refreshReference, refreshReferences, removeFromCache, setLocale, toClass |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLPersister(String key,
Repository repo,
Principal princ,
MBeanReference pbf)
throws ConstructionException,
IOException
key - the key.repo - the repository.princ - the principal.pbf - the persister factory.
IOException - on I/O errors.
ConstructionException - on parsing errors.| Method Detail |
|---|
public void close()
Persister
close in interface Persisterclose in class PersisterAdapterpublic Object toIdentity(Object sample)
Persister
sample - the sample object.
public String getKeyAttribute(String className)
Persister
getKeyAttribute in interface PersistergetKeyAttribute in class PersisterAdapterclassName - the class name.
public String[] getKeyAttributes(String className)
Persister
getKeyAttributes in interface PersistergetKeyAttributes in class PersisterAdapterclassName - the class name.
public DBCriteria getCriteria()
Persister
public DBCriteria getCriteria(Object criteria)
Persister
criteria - the initial criteria.
public DBQuery buildQuery(Object sample)
Persister
sample - the sample, identity or class.
public DBQuery buildQuery(Class clazz,
String expr,
boolean sql)
Persister
clazz - the class to query.expr - the query expression.sql - the SQL flag.
public DBQuery buildQuery(Class clazz,
DBCriteria criteria,
boolean distinct)
Persister
clazz - the class to query.criteria - an implementation specific criteria.distinct - a flag to indicate a distinct query.
public DBQuery buildQuery(Class clazz,
String[] attributes,
DBCriteria criteria,
boolean distinct)
Persister
clazz - the class to query.attributes - the attributes to return.criteria - in implementation specific criteria.distinct - a flag to indicate a distinct query.
public Object queryObject(DBQuery query)
throws PersisterException
Persister
query - the query.
PersisterException - on errors.
public Collection queryObjects(DBQuery query)
throws PersisterException
Persister
query - the query.
PersisterException - on errors.
public QueryIterator queryIterator(DBQuery query)
throws PersisterException
Persister
query - the query.
PersisterException - on errors.public int queryCount(DBQuery query)
Persister
query - the query.
public void storeObject(Object object)
throws PersisterException
Persister
object - the object to store.
PersisterException - on errors.
public void storeObjects(Collection objects)
throws PersisterException
Persister
objects - the objects to store.
PersisterException - on errors.
public void insertObject(Object object)
throws PersisterException
Persister
object - the object to insert.
PersisterException - on errors.
public void insertObjects(Collection objects)
throws PersisterException
Persister
objects - the objects to insert.
PersisterException - on errors.
public void updateObject(Object object)
throws PersisterException
Persister
object - the object to update.
PersisterException - on errors.
public void updateObjects(Collection objects)
throws PersisterException
Persister
objects - the objects to update.
PersisterException - on errors.
public void deleteObject(Object object)
throws PersisterException
Persister
object - the object to delete.
PersisterException - on errors.
public void deleteObjects(Collection objects)
throws PersisterException
Persister
objects - the objects to delete.
PersisterException - on errors.
public void deleteObjects(DBQuery query)
throws PersisterException
Persister
query - the query.
PersisterException - on errors.public boolean isTransactionsSupported()
Persister
isTransactionsSupported in interface PersisterisTransactionsSupported in class PersisterAdapterpublic boolean isInTransaction()
Persister
isInTransaction in interface PersisterisInTransaction in class PersisterAdapterpublic void beginTransaction()
PersisterNo-op if transactions are not supported.
beginTransaction in interface PersisterbeginTransaction in class PersisterAdapterpublic void abortTransaction()
PersisterNo-op if transactions are not supported.
abortTransaction in interface PersisterabortTransaction in class PersisterAdapterpublic void commitTransaction()
PersisterNo-op if transactions are not supported.
commitTransaction in interface PersistercommitTransaction in class PersisterAdapterpublic String getRepository(String className)
Persister
getRepository in interface PersistergetRepository in class PersisterAdapterclassName - the class name.
public Collection load(File file)
throws PersisterException
Persister
load in interface Persisterload in class PersisterAdapterfile - the dump file.
PersisterException - for loading errors.
public void dump(Collection objects,
File file)
throws PersisterException
Persister
dump in interface Persisterdump in class PersisterAdapterobjects - a collection of objects to dump.file - the dump file.
PersisterException - for dumping errors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||