public class DatabaseImpl extends java.lang.Object implements Database
Database interface.NOT_OPEN, OPEN_EXCLUSIVE, OPEN_READ_ONLY, OPEN_READ_WRITE| Constructor and Description |
|---|
DatabaseImpl(ImplementationImpl ojb) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(java.lang.Object object,
java.lang.String name)
Associate a name with an object and make it persistent.
|
void |
close()
Close the database.
|
void |
deletePersistent(java.lang.Object object)
Deletes an object from the database.
|
PBKey |
getPBKey()
Return the
PBKey associated with this Database. |
boolean |
isOpen() |
java.lang.Object |
lookup(java.lang.String name)
Lookup an object via its name.
|
void |
makePersistent(java.lang.Object object)
Make a transient object durable in the database.
|
void |
open(java.lang.String name,
int accessMode)
Open the named database with the specified access mode.
|
void |
unbind(java.lang.String name)
Disassociate a name with an object
|
public DatabaseImpl(ImplementationImpl ojb)
public boolean isOpen()
public void open(java.lang.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(java.lang.Object object,
java.lang.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 java.lang.Object lookup(java.lang.String name)
throws ObjectNameNotFoundException
lookup in interface Databasename - The name of an object.ObjectNameNotFoundException - There is no object with the specified name.
ObjectNameNotFoundExceptionObjectNameNotFoundExceptionpublic void unbind(java.lang.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(java.lang.Object object)
makePersistent in interface Databaseobject - The object to make persistent.TransactionNotInProgressException - if there is no current transaction.public void deletePersistent(java.lang.Object object)
deletePersistent in interface Databaseobject - The object to delete.(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30