|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.ojb.odmg.DatabaseImpl
public class DatabaseImpl
Implementation class of the Database interface.
| Field Summary | |
|---|---|
private boolean |
isOpen
|
private Logger |
log
|
private ImplementationImpl |
odmg
|
private PBKey |
pbKey
|
| Fields inherited from interface org.odmg.Database |
|---|
NOT_OPEN, OPEN_EXCLUSIVE, OPEN_READ_ONLY, OPEN_READ_WRITE |
| Constructor Summary | |
|---|---|
DatabaseImpl(ImplementationImpl ojb)
|
|
| Method Summary | |
|---|---|
void |
bind(Object object,
String name)
Associate a name with an object and make it persistent. |
void |
close()
Close the database. |
void |
deletePersistent(Object object)
Deletes an object from the database. |
PBKey |
getPBKey()
Return the PBKey associated with this Database. |
private TransactionImpl |
getTransaction()
|
boolean |
isOpen()
|
Object |
lookup(String name)
Lookup an object via its name. |
void |
makePersistent(Object object)
Make a transient object durable in the database. |
void |
open(String name,
int accessMode)
Open the named database with the specified access mode. |
void |
unbind(String name)
Disassociate a name with an object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Logger log
private PBKey pbKey
private boolean isOpen
private ImplementationImpl odmg
| Constructor Detail |
|---|
public DatabaseImpl(ImplementationImpl ojb)
| Method Detail |
|---|
private TransactionImpl getTransaction()
public PBKey getPBKey()
PBKey associated with this Database.
public boolean isOpen()
public void open(String name,
int accessMode)
throws ODMGException
DatabaseOpenException.
A DatabaseNotFoundException is thrown if the database does not exist.
Some implementations may throw additional exceptions that are also derived from
ODMGException.
open in interface Databasename - The name of the database.accessMode - The access mode, which should be one of the static fields:
OPEN_READ_ONLY, OPEN_READ_WRITE,
or OPEN_EXCLUSIVE.
ODMGException - The database could not be opened.
public void close()
throws ODMGException
DatabaseClosedException to be thrown.
Some implementations may throw additional exceptions that are also derived
from ODMGException.
close in interface DatabaseODMGException - Unable to close the database.
public void bind(Object object,
String name)
throws ObjectNameNotUniqueException
bind in interface Databaseobject - The object to be named.name - The name to be given to the object.
ObjectNameNotUniqueException - If an attempt is made to bind a name to an object and that name is already bound
to an object.
public Object lookup(String name)
throws ObjectNameNotFoundException
lookup in interface Databasename - The name of an object.
ObjectNameNotFoundException - There is no object with the specified name.
ObjectNameNotFoundExceptionObjectNameNotFoundException
public void unbind(String name)
throws ObjectNameNotFoundException
unbind in interface Databasename - The name of an object.
ObjectNameNotFoundException - No object exists in the database with that name.public void makePersistent(Object object)
makePersistent in interface Databaseobject - The object to make persistent.
TransactionNotInProgressException - if there is no current transaction.public void deletePersistent(Object object)
deletePersistent in interface Databaseobject - The object to delete.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||