|
||||||||||
| 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.hibernate.HibernatePersister
public class HibernatePersister
Hibernate specific implementation of Persister.
| Constructor Summary | |
|---|---|
HibernatePersister(String alias,
org.hibernate.Session session,
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 |
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 |
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. |
DBCriteria |
getCriteria()
Gets implementation specific criteria. |
DBCriteria |
getCriteria(Object criteria)
Gets initialized implementation specific criteria. |
String[] |
getKeyAttributes(String className)
Gets the primary key attributes 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 |
isPersistentAttribute(String className,
String attribute)
Checks whether an attribute of the named class is persistent. |
boolean |
isTransactionsSupported()
Checks whether this persister implementation supports transactions. |
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 |
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 |
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, deleteObjects, deleteObjects, deleteObjects, deleteObjects, dump, getAdaptee, getConnectionKey, getKeyAttribute, getKeyAttribute, getKeyAttributes, getLocale, getMBeanReferent, getMBeanServer, getPersisterFactory, getPrincipal, getRepository, isClosed, isPersistentAttribute, load, modified, queryBySample, queryCount, queryCount, queryCount, queryCount, queryIterator, queryIterator, queryIterator, queryIterator, queryObject, queryObject, queryObject, queryObject, queryObjects, queryObjects, queryObjects, queryObjects, setLocale, toClass |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HibernatePersister(String alias,
org.hibernate.Session session,
Principal princ,
MBeanReference pbf)
alias - the connection alias.session - the session.princ - the principal.pbf - the persister factory.| Method Detail |
|---|
public void close()
Persister
close in interface Persisterclose in class PersisterAdapterpublic void clearCache()
Persister
clearCache in interface PersisterclearCache in class PersisterAdapterpublic void removeFromCache(Object object)
Persister
removeFromCache in interface PersisterremoveFromCache in class PersisterAdapterobject - the object.
public void refreshReferences(Object object,
boolean force)
Persister
refreshReferences in interface PersisterrefreshReferences in class PersisterAdapterobject - the object.force - force the refresh if true, otherwise false.
public void refreshReference(Object object,
String name,
boolean force)
Persister
refreshReference in interface PersisterrefreshReference in class PersisterAdapterobject - the object.name - the reference attribute.force - force the refresh if true, otherwise false.public Object toIdentity(Object sample)
Persister
sample - the sample object.
public String[] getKeyAttributes(String className)
Persister
getKeyAttributes in interface PersistergetKeyAttributes in class PersisterAdapterclassName - the class name.
public boolean isPersistentAttribute(String className,
String attribute)
Persister
isPersistentAttribute in interface PersisterisPersistentAttribute in class PersisterAdapterclassName - the class name.attribute - the field.
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 PersisterAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||