|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.hibernate.odmg.Database
Implements the ODMG Database API. This provides operations for
persisting and deleteing objects, binding names to objects and looking
up objects by name.
Applications may create an instance by calling
Implementation.newDatabase() or by instantiating this class
directly. The application should then call open() to associate
it with an existing Hibernate SessionFactory.
Instances maintain an association between Threads and
Transactions.
Implementation,
Transaction| Field Summary |
| Fields inherited from interface org.odmg.Database |
NOT_OPEN, OPEN_EXCLUSIVE, OPEN_READ_ONLY, OPEN_READ_WRITE |
| Constructor Summary | |
Database()
Instantiate |
|
| Method Summary | |
void |
bind(Object object,
String name)
Bind a name to a persistent object, making the object persistent if necessary. |
void |
close()
Close the Database (but not the underlying SessionFactory). |
Transaction |
currentTransaction()
Get the Transaction associatedm with the current thread. |
void |
deletePersistent(Object object)
Delete the given object from the database. |
Session |
getSession()
Get the Session underlying the Transaction associated with the current thread. |
SessionFactory |
getSessionFactory()
Get the SessionFactory underlying this Database. |
Object |
lookup(String name)
Retrieve the persistent object bound to the given name. |
void |
makePersistent(Object object)
Make the given object persistent. |
void |
open(SessionFactory factory)
Specify the underlying SessionFactory. |
void |
open(String name,
int accessMode)
Specify the underlying SessionFactory, by passing a JNDI name. |
void |
unbind(String name)
Unbind the given name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Database()
| Method Detail |
public void open(SessionFactory factory)
public Session getSession()
public SessionFactory getSessionFactory()
public Transaction currentTransaction()
public void open(String name, int accessMode) throws org.odmg.ODMGException
open in interface org.odmg.Databaseorg.odmg.ODMGExceptionDatabase.open(String, int)
public void close()
throws org.odmg.ODMGException
close in interface org.odmg.Databaseorg.odmg.ODMGExceptionDatabase.close()public void bind(Object object, String name) throws org.odmg.ObjectNameNotUniqueException
bind in interface org.odmg.Databaseorg.odmg.ObjectNameNotUniqueExceptionDatabase.bind(Object, String)public Object lookup(String name) throws org.odmg.ObjectNameNotFoundException
lookup in interface org.odmg.Databaseorg.odmg.ObjectNameNotFoundExceptionDatabase.lookup(String)public void unbind(String name) throws org.odmg.ObjectNameNotFoundException
unbind in interface org.odmg.Databaseorg.odmg.ObjectNameNotFoundExceptionDatabase.unbind(String)public void makePersistent(Object object)
makePersistent in interface org.odmg.DatabaseDatabase.makePersistent(Object)public void deletePersistent(Object object)
deletePersistent in interface org.odmg.DatabaseDatabase.deletePersistent(Object)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||