org.neodatis.odb
Interface ODB
-
- All Known Implementing Classes:
- LocalODB, ODBAdapter, ODBForTrigger, RemoteODBClient, SameVMODBClient, ThreadSafeLocalODB
public interface ODBThe main ODB public interface: It is what the user sees.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated 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 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 databaseValuesgetValues(IValuesQuery query)Search for objects that matches the query.booleanisClosed()voidreconnect(java.lang.Object object)Deprecated.Reconnection is now automatic Used to reconnect an object to the current sessionvoidrollback()Undo all uncommitted changesOIDstore(java.lang.Object object)Store a plain java Object in the ODB Database
-
-
-
Method Detail
-
commit
void commit()
Commit all the change of the database @
-
rollback
void rollback()
Undo all uncommitted changes
-
close
void close()
Closes the database. Automatically commit uncommitted changes
-
store
OID store(java.lang.Object object)
Store a plain java Object in the ODB Database- Parameters:
object- A plain Java Object
-
getObjects
<T> Objects<T> getObjects(java.lang.Class clazz)
Get all objects of a specific type- Parameters:
clazz- The type of the objects- Returns:
- The list of objects
-
getObjects
<T> Objects<T> getObjects(java.lang.Class clazz, boolean inMemory)
Get all objects of a specific type- Parameters:
clazz- The type of the objectsinMemory- if true, preload all objects,if false,load on demand- Returns:
- The list of objects
-
getObjects
<T> Objects<T> getObjects(java.lang.Class clazz, boolean inMemory, int startIndex, int endIndex)
- 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
-
delete
OID delete(java.lang.Object object)
Delete an object from database- Parameters:
object-
-
deleteCascade
OID deleteCascade(java.lang.Object object)
Delete an object and all its sub objects- Parameters:
object-cascade-- Returns:
-
deleteObjectWithId
void deleteObjectWithId(OID oid)
Delete an object from the database with the id- Parameters:
oid- The object id to be deleted
-
getValues
Values getValues(IValuesQuery query)
Search for objects that matches the query.- Parameters:
query-- Returns:
- The list of values
-
getObjects
<T> Objects<T> getObjects(IQuery query)
Search for objects that matches the query.- Parameters:
query-- Returns:
- The list of objects
-
getObjects
<T> Objects<T> getObjects(IQuery query, boolean inMemory)
Search for objects that matches the native query.- Parameters:
query-inMemory-- Returns:
- The list of objects
-
getObjects
<T> Objects<T> getObjects(IQuery query, boolean inMemory, int startIndex, int endIndex)
Return a list of objects that matches the query- Parameters:
query-inMemory- 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
-
count
java.math.BigInteger count(CriteriaQuery query)
Returns the number of objects that satisfy the query- Parameters:
query-- Returns:
- The number of objects that satisfy the query
-
getObjectId
OID getObjectId(java.lang.Object object)
Get the id of an ODB-aware object- Parameters:
object-- Returns:
- The ODB internal object id
-
getObjectFromId
java.lang.Object getObjectFromId(OID id)
Get the object with a specific id *- Parameters:
id-- Returns:
- The object with the specific id @
-
defragmentTo
void defragmentTo(java.lang.String newFileName)
Defragment ODB Database- Parameters:
newFileName-
-
getClassRepresentation
ClassRepresentation getClassRepresentation(java.lang.Class clazz)
Get an abstract representation of a class- Parameters:
clazz-- Returns:
- a public meta-representation of a class
-
getClassRepresentation
ClassRepresentation getClassRepresentation(java.lang.String fullClassName)
Get an abstract representation of a class- Parameters:
fullClassName-- Returns:
- a public meta-representation of a class
-
getClassRepresentation
ClassRepresentation getClassRepresentation(java.lang.String fullClassName, boolean laodClass)
-
addUpdateTrigger
void addUpdateTrigger(java.lang.Class clazz, UpdateTrigger trigger)Used to add an update trigger callback for the specific class- Parameters:
trigger-
-
addInsertTrigger
void addInsertTrigger(java.lang.Class clazz, InsertTrigger trigger)Used to add an insert trigger callback for the specific class- Parameters:
trigger-
-
addDeleteTrigger
void addDeleteTrigger(java.lang.Class clazz, DeleteTrigger trigger)USed to add a delete trigger callback for the specific class- Parameters:
trigger-
-
addSelectTrigger
void addSelectTrigger(java.lang.Class clazz, SelectTrigger trigger)Used to add a select trigger callback for the specific class- Parameters:
trigger-
-
getRefactorManager
IRefactorManager getRefactorManager()
Returns the object used to refactor the database
-
ext
ODBExt ext()
Get the extension of ODB to get access to advanced functions
-
reconnect
void reconnect(java.lang.Object object)
Deprecated. Reconnection is now automatic Used to reconnect an object to the current session
-
disconnect
void disconnect(java.lang.Object object)
Used to disconnect the object from the current session. The object is removed from the cache
-
isClosed
boolean isClosed()
- Returns:
-
criteriaQuery
CriteriaQuery criteriaQuery(java.lang.Class clazz, ICriterion criterio)
-
criteriaQuery
CriteriaQuery criteriaQuery(java.lang.Class clazz)
-
getName
java.lang.String getName()
Return the name of the database- Returns:
- the file name in local mode and the base id (alias) in client server mode.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG