org.neodatis.odb.impl.main
Class ThreadSafeLocalODB
- java.lang.Object
-
- org.neodatis.odb.impl.main.ThreadSafeLocalODB
-
-
Constructor Summary
Constructors Constructor and Description ThreadSafeLocalODB(ODB odb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddDeleteTrigger(java.lang.Class clazz, DeleteTrigger trigger)USed to add a delete trigger callback for the specific classvoidaddInsertTrigger(java.lang.Class clazz, InsertTrigger trigger)Used to add an insert trigger callback for the specific classvoidaddSelectTrigger(java.lang.Class clazz, SelectTrigger trigger)Used to add a select trigger callback for the specific classvoidaddUpdateTrigger(java.lang.Class clazz, UpdateTrigger trigger)Used to add an update trigger callback for the specific classvoidclose()Closes the database.voidcommit()Commit all the change of the database @java.math.BigIntegercount(CriteriaQuery query)Returns the number of objects that satisfy the queryCriteriaQuerycriteriaQuery(java.lang.Class clazz)CriteriaQuerycriteriaQuery(java.lang.Class clazz, ICriterion criterio)voiddefragmentTo(java.lang.String newFileName)Defragment ODB DatabaseOIDdelete(java.lang.Object object)Delete an object from databaseOIDdeleteCascade(java.lang.Object object)Delete an object and all its sub objectsvoiddeleteObjectWithId(OID oid)Delete an object from the database with the idvoiddisconnect(java.lang.Object object)Used to disconnect the object from the current session.ODBExtext()Get the extension of ODB to get access to advanced functionsClassRepresentationgetClassRepresentation(java.lang.Class clazz)Get an abstract representation of a classClassRepresentationgetClassRepresentation(java.lang.String fullClassName)Get an abstract representation of a classClassRepresentationgetClassRepresentation(java.lang.String fullClassName, boolean laodClass)java.lang.StringgetName()Return the name of the databaseODBgetNonThreadSafeOdb()java.lang.ObjectgetObjectFromId(OID id)Get the object with a specific id *OIDgetObjectId(java.lang.Object object)Get the id of an ODB-aware object<T> Objects<T>getObjects(java.lang.Class clazz)Get all objects of a specific type<T> Objects<T>getObjects(java.lang.Class clazz, boolean inMemory)Get all objects of a specific type<T> Objects<T>getObjects(java.lang.Class clazz, boolean inMemory, int startIndex, int endIndex)<T> Objects<T>getObjects(IQuery query)Search for objects that matches the query.<T> Objects<T>getObjects(IQuery query, boolean inMemory)Search for objects that matches the native query.<T> Objects<T>getObjects(IQuery query, boolean inMemory, int startIndex, int endIndex)Return a list of objects that matches the queryIRefactorManagergetRefactorManager()Returns the object used to refactor the databaseValuesgetValues(IValuesQuery query)Search for objects that matches the query.booleanisClosed()voidreconnect(java.lang.Object object)voidrollback()Undo all uncommitted changesOIDstore(java.lang.Object object)Store a plain java Object in the ODB Database
-
-
-
Constructor Detail
-
ThreadSafeLocalODB
public ThreadSafeLocalODB(ODB odb)
-
-
Method Detail
-
getNonThreadSafeOdb
public ODB getNonThreadSafeOdb()
-
addDeleteTrigger
public void addDeleteTrigger(java.lang.Class clazz, DeleteTrigger trigger)Description copied from interface:ODBUSed to add a delete trigger callback for the specific class- Specified by:
addDeleteTriggerin interfaceODB
-
addInsertTrigger
public void addInsertTrigger(java.lang.Class clazz, InsertTrigger trigger)Description copied from interface:ODBUsed to add an insert trigger callback for the specific class- Specified by:
addInsertTriggerin interfaceODB
-
addSelectTrigger
public void addSelectTrigger(java.lang.Class clazz, SelectTrigger trigger)Description copied from interface:ODBUsed to add a select trigger callback for the specific class- Specified by:
addSelectTriggerin interfaceODB
-
addUpdateTrigger
public void addUpdateTrigger(java.lang.Class clazz, UpdateTrigger trigger)Description copied from interface:ODBUsed to add an update trigger callback for the specific class- Specified by:
addUpdateTriggerin interfaceODB
-
close
public void close()
Description copied from interface:ODBCloses the database. Automatically commit uncommitted changes
-
commit
public void commit()
Description copied from interface:ODBCommit all the change of the database @
-
count
public java.math.BigInteger count(CriteriaQuery query)
Description copied from interface:ODBReturns the number of objects that satisfy the query
-
criteriaQuery
public CriteriaQuery criteriaQuery(java.lang.Class clazz, ICriterion criterio)
- Specified by:
criteriaQueryin interfaceODB
-
criteriaQuery
public CriteriaQuery criteriaQuery(java.lang.Class clazz)
- Specified by:
criteriaQueryin interfaceODB
-
defragmentTo
public void defragmentTo(java.lang.String newFileName)
Description copied from interface:ODBDefragment ODB Database- Specified by:
defragmentToin interfaceODB
-
delete
public OID delete(java.lang.Object object)
Description copied from interface:ODBDelete an object from database
-
deleteCascade
public OID deleteCascade(java.lang.Object object)
Description copied from interface:ODBDelete an object and all its sub objects- Specified by:
deleteCascadein interfaceODB- Returns:
-
deleteObjectWithId
public void deleteObjectWithId(OID oid)
Description copied from interface:ODBDelete an object from the database with the id- Specified by:
deleteObjectWithIdin interfaceODB- Parameters:
oid- The object id to be deleted
-
disconnect
public void disconnect(java.lang.Object object)
Description copied from interface:ODBUsed to disconnect the object from the current session. The object is removed from the cache- Specified by:
disconnectin interfaceODB
-
ext
public ODBExt ext()
Description copied from interface:ODBGet the extension of ODB to get access to advanced functions
-
getClassRepresentation
public ClassRepresentation getClassRepresentation(java.lang.Class clazz)
Description copied from interface:ODBGet an abstract representation of a class- Specified by:
getClassRepresentationin interfaceODB- Returns:
- a public meta-representation of a class
-
getClassRepresentation
public ClassRepresentation getClassRepresentation(java.lang.String fullClassName)
Description copied from interface:ODBGet an abstract representation of a class- Specified by:
getClassRepresentationin interfaceODB- Returns:
- a public meta-representation of a class
-
getClassRepresentation
public ClassRepresentation getClassRepresentation(java.lang.String fullClassName, boolean laodClass)
- Specified by:
getClassRepresentationin interfaceODB
-
getName
public java.lang.String getName()
Description copied from interface:ODBReturn the name of the database
-
getObjectFromId
public java.lang.Object getObjectFromId(OID id)
Description copied from interface:ODBGet the object with a specific id *- Specified by:
getObjectFromIdin interfaceODB- Returns:
- The object with the specific id @
-
getObjectId
public OID getObjectId(java.lang.Object object)
Description copied from interface:ODBGet the id of an ODB-aware object- Specified by:
getObjectIdin interfaceODB- Returns:
- The ODB internal object id
-
getObjects
public <T> Objects<T> getObjects(java.lang.Class clazz, boolean inMemory, int startIndex, int endIndex)
- Specified by:
getObjectsin interfaceODB- Parameters:
clazz- The type of the objectsinMemory- if true, preload all objects,if false,load on demandstartIndex- The index of the first objectendIndex- The index of the last object that must be returned- Returns:
- A List of objects
-
getObjects
public <T> Objects<T> getObjects(java.lang.Class clazz, boolean inMemory)
Description copied from interface:ODBGet all objects of a specific type- Specified by:
getObjectsin interfaceODB- Parameters:
clazz- The type of the objectsinMemory- if true, preload all objects,if false,load on demand- Returns:
- The list of objects
-
getObjects
public <T> Objects<T> getObjects(java.lang.Class clazz)
Description copied from interface:ODBGet all objects of a specific type- Specified by:
getObjectsin interfaceODB- Parameters:
clazz- The type of the objects- Returns:
- The list of objects
-
getObjects
public <T> Objects<T> getObjects(IQuery query, boolean inMemory, int startIndex, int endIndex)
Description copied from interface:ODBReturn a list of objects that matches the query- Specified by:
getObjectsin interfaceODBinMemory- if true, preload all objects,if false,load on demandstartIndex- The index of the first objectendIndex- The index of the last object that must be returned- Returns:
- A List of objects, if start index and end index are -1, they are ignored. If not, the length of the sublist is endIndex - startIndex
-
getObjects
public <T> Objects<T> getObjects(IQuery query, boolean inMemory)
Description copied from interface:ODBSearch for objects that matches the native query.- Specified by:
getObjectsin interfaceODB- Returns:
- The list of objects
-
getObjects
public <T> Objects<T> getObjects(IQuery query)
Description copied from interface:ODBSearch for objects that matches the query.- Specified by:
getObjectsin interfaceODB- Returns:
- The list of objects
-
getRefactorManager
public IRefactorManager getRefactorManager()
Description copied from interface:ODBReturns the object used to refactor the database- Specified by:
getRefactorManagerin interfaceODB
-
getValues
public Values getValues(IValuesQuery query)
Description copied from interface:ODBSearch for objects that matches the query.
-
rollback
public void rollback()
Description copied from interface:ODBUndo all uncommitted changes
-
-
DataMelt 3.0 © DataMelt by jWork.ORG