|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neodatis.odb.impl.main.ODBAdapter
public abstract class ODBAdapter
A basic adapter for ODB interface
Field Summary | |
---|---|
protected IClassIntrospector |
classIntrospector
|
protected IStorageEngine |
storageEngine
|
Constructor Summary | |
---|---|
ODBAdapter(IStorageEngine storageEngine)
|
Method Summary | ||
---|---|---|
void |
addDeleteTrigger(java.lang.Class clazz,
DeleteTrigger trigger)
USed to add a delete trigger callback for the specific class |
|
void |
addInsertTrigger(java.lang.Class clazz,
InsertTrigger trigger)
Used to add an insert trigger callback for the specific class |
|
void |
addSelectTrigger(java.lang.Class clazz,
SelectTrigger trigger)
Used to add a select trigger callback for the specific class |
|
void |
addUpdateTrigger(java.lang.Class clazz,
UpdateTrigger trigger)
Used to add an update trigger callback for the specific class |
|
void |
close()
Closes the database. |
|
void |
commit()
Commit all the change of the database @ |
|
void |
commitAndClose()
|
|
java.math.BigInteger |
count(CriteriaQuery query)
Returns the number of objects that satisfy the query |
|
CriteriaQuery |
criteriaQuery(java.lang.Class clazz)
|
|
CriteriaQuery |
criteriaQuery(java.lang.Class clazz,
ICriterion criterion)
|
|
void |
defragmentTo(java.lang.String newFileName)
Defragment ODB Database |
|
OID |
delete(java.lang.Object object)
Delete an object from database |
|
OID |
deleteCascade(java.lang.Object object)
Delete an object and all its sub objects |
|
void |
deleteObjectWithId(OID oid)
Delete an object from the database with the id |
|
void |
disconnect(java.lang.Object object)
Used to disconnect the object from the current session. |
|
ODBExt |
ext()
Get the extension of ODB to get access to advanced functions |
|
ClassRepresentation |
getClassRepresentation(java.lang.Class clazz)
Get an abstract representation of a class |
|
ClassRepresentation |
getClassRepresentation(java.lang.String fullClassName)
Get an abstract representation of a class |
|
ClassRepresentation |
getClassRepresentation(java.lang.String fullClassName,
boolean loadClass)
|
|
java.lang.String |
getName()
Return the name of the database |
|
java.lang.Object |
getObjectFromId(OID id)
Get the object with a specific id * |
|
OID |
getObjectId(java.lang.Object object)
Get the id of an ODB-aware object |
|
|
getObjects(java.lang.Class clazz)
Get all objects of a specific type |
|
|
getObjects(java.lang.Class clazz,
boolean inMemory)
Get all objects of a specific type |
|
|
getObjects(java.lang.Class clazz,
boolean inMemory,
int startIndex,
int endIndex)
|
|
|
getObjects(IQuery query)
Search for objects that matches the query. |
|
|
getObjects(IQuery query,
boolean inMemory)
Search for objects that matches the native query. |
|
|
getObjects(IQuery query,
boolean inMemory,
int startIndex,
int endIndex)
Return a list of objects that matches the query |
|
IRefactorManager |
getRefactorManager()
Returns the object used to refactor the database |
|
ISession |
getSession()
|
|
Values |
getValues(IValuesQuery query)
Search for objects that matches the query. |
|
boolean |
isClosed()
|
|
void |
reconnect(java.lang.Object object)
|
|
void |
rollback()
Undo all uncommitted changes |
|
void |
run()
or shutdown hook |
|
OID |
store(java.lang.Object object)
Store a plain java Object in the ODB Database |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IStorageEngine storageEngine
protected IClassIntrospector classIntrospector
Constructor Detail |
---|
public ODBAdapter(IStorageEngine storageEngine)
Method Detail |
---|
public void commit()
ODB
commit
in interface ODB
public void rollback()
ODB
rollback
in interface ODB
public void commitAndClose()
public OID store(java.lang.Object object)
ODB
store
in interface ODB
object
- A plain Java Objectpublic <T> Objects<T> getObjects(java.lang.Class clazz)
ODB
getObjects
in interface ODB
clazz
- The type of the objects
public <T> Objects<T> getObjects(java.lang.Class clazz, boolean inMemory)
ODB
getObjects
in interface ODB
clazz
- The type of the objectsinMemory
- if true, preload all objects,if false,load on demand
public <T> Objects<T> getObjects(java.lang.Class clazz, boolean inMemory, int startIndex, int endIndex)
getObjects
in interface ODB
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
public void close()
ODB
close
in interface ODB
public OID delete(java.lang.Object object)
ODB
delete
in interface ODB
public OID deleteCascade(java.lang.Object object)
ODB
deleteCascade
in interface ODB
public void deleteObjectWithId(OID oid)
deleteObjectWithId
in interface ODB
oid
- The object id to be deleted @public <T> Objects<T> getObjects(IQuery query)
ODB
getObjects
in interface ODB
public Values getValues(IValuesQuery query)
ODB
getValues
in interface ODB
public java.math.BigInteger count(CriteriaQuery query)
ODB
count
in interface ODB
public <T> Objects<T> getObjects(IQuery query, boolean inMemory)
ODB
getObjects
in interface ODB
public <T> Objects<T> getObjects(IQuery query, boolean inMemory, int startIndex, int endIndex)
ODB
getObjects
in interface ODB
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
public ISession getSession()
public OID getObjectId(java.lang.Object object)
ODB
getObjectId
in interface ODB
public java.lang.Object getObjectFromId(OID id)
ODB
getObjectFromId
in interface ODB
public void defragmentTo(java.lang.String newFileName)
ODB
defragmentTo
in interface ODB
public ClassRepresentation getClassRepresentation(java.lang.Class clazz)
ODB
getClassRepresentation
in interface ODB
public ClassRepresentation getClassRepresentation(java.lang.String fullClassName)
ODB
getClassRepresentation
in interface ODB
public ClassRepresentation getClassRepresentation(java.lang.String fullClassName, boolean loadClass)
getClassRepresentation
in interface ODB
public void run()
public void addUpdateTrigger(java.lang.Class clazz, UpdateTrigger trigger)
ODB
addUpdateTrigger
in interface ODB
public void addInsertTrigger(java.lang.Class clazz, InsertTrigger trigger)
ODB
addInsertTrigger
in interface ODB
public void addDeleteTrigger(java.lang.Class clazz, DeleteTrigger trigger)
ODB
addDeleteTrigger
in interface ODB
public void addSelectTrigger(java.lang.Class clazz, SelectTrigger trigger)
ODB
addSelectTrigger
in interface ODB
public IRefactorManager getRefactorManager()
ODB
getRefactorManager
in interface ODB
public ODBExt ext()
ODB
ext
in interface ODB
public void disconnect(java.lang.Object object)
ODB
disconnect
in interface ODB
public void reconnect(java.lang.Object object)
reconnect
in interface ODB
public boolean isClosed()
isClosed
in interface ODB
public CriteriaQuery criteriaQuery(java.lang.Class clazz, ICriterion criterion)
criteriaQuery
in interface ODB
public CriteriaQuery criteriaQuery(java.lang.Class clazz)
criteriaQuery
in interface ODB
public java.lang.String getName()
ODB
getName
in interface ODB
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |