org.neodatis.odb.impl.main
Class ODBAdapter
- java.lang.Object
-
- org.neodatis.odb.impl.main.ODBAdapter
-
- All Implemented Interfaces:
- ODB
- Direct Known Subclasses:
- LocalODB, ODBForTrigger, RemoteODBClient, SameVMODBClient
public abstract class ODBAdapter extends java.lang.Object implements ODB
A basic adapter for ODB interface
-
-
Constructor Summary
Constructors Constructor and Description ODBAdapter(IStorageEngine storageEngine)
-
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 @voidcommitAndClose()java.math.BigIntegercount(CriteriaQuery query)Returns the number of objects that satisfy the queryCriteriaQuerycriteriaQuery(java.lang.Class clazz)CriteriaQuerycriteriaQuery(java.lang.Class clazz, ICriterion criterion)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 loadClass)java.lang.StringgetName()Return the name of the databasejava.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 databaseISessiongetSession()ValuesgetValues(IValuesQuery query)Search for objects that matches the query.booleanisClosed()voidreconnect(java.lang.Object object)voidrollback()Undo all uncommitted changesvoidrun()or shutdown hookOIDstore(java.lang.Object object)Store a plain java Object in the ODB Database
-
-
-
Constructor Detail
-
ODBAdapter
public ODBAdapter(IStorageEngine storageEngine)
-
-
Method Detail
-
commit
public void commit()
Description copied from interface:ODBCommit all the change of the database @
-
rollback
public void rollback()
Description copied from interface:ODBUndo all uncommitted changes
-
commitAndClose
public void commitAndClose()
-
store
public OID store(java.lang.Object object)
Description copied from interface:ODBStore a plain java Object in the ODB Database
-
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(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, 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
-
close
public void close()
Description copied from interface:ODBCloses the database. Automatically commit uncommitted changes
-
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)
Delete an object from the database with the id- Specified by:
deleteObjectWithIdin interfaceODB- Parameters:
oid- The object id to be deleted @
-
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
-
getValues
public Values getValues(IValuesQuery query)
Description copied from interface:ODBSearch for objects that matches the query.
-
count
public java.math.BigInteger count(CriteriaQuery query)
Description copied from interface:ODBReturns the number of objects that satisfy the query
-
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, 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
-
getSession
public ISession getSession()
-
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
-
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 @
-
defragmentTo
public void defragmentTo(java.lang.String newFileName)
Description copied from interface:ODBDefragment ODB Database- Specified by:
defragmentToin interfaceODB
-
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 loadClass)
- Specified by:
getClassRepresentationin interfaceODB
-
run
public void run()
or shutdown hook
-
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
-
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
-
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
-
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
-
getRefactorManager
public IRefactorManager getRefactorManager()
Description copied from interface:ODBReturns the object used to refactor the database- Specified by:
getRefactorManagerin interfaceODB
-
ext
public ODBExt ext()
Description copied from interface:ODBGet the extension of ODB to get access to advanced functions
-
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
-
criteriaQuery
public CriteriaQuery criteriaQuery(java.lang.Class clazz, ICriterion criterion)
- Specified by:
criteriaQueryin interfaceODB
-
criteriaQuery
public CriteriaQuery criteriaQuery(java.lang.Class clazz)
- Specified by:
criteriaQueryin interfaceODB
-
-
DataMelt 3.0 © DataMelt by jWork.ORG