ojb.odmg
Class OJB

java.lang.Object
  |
  +--ojb.odmg.OJB
All Implemented Interfaces:
Implementation

public final class OJB
extends java.lang.Object
implements Implementation

Facade to the persistence ObjectServer system. Implements the factory interface for a particular ODMG implementation.

Version:
ODMG 3.0
Author:
Thomas Mahler

Method Summary
 Transaction currentTransaction()
          Get the current Transaction for the thread.
 Database getDatabase(java.lang.Object obj)
          Get the Database that contains the object obj.
static OJB getInstance()
          return singleton instance
static Logger getLogger()
           
 java.lang.String getObjectId(java.lang.Object obj)
          Get a String representation of the object's identifier.
 DArray newDArray()
          Create a new DArray object.
 Database newDatabase()
          Create a new Database object.
 DBag newDBag()
          Create a new DBag object.
 DList newDList()
          Create a new DList object.
 DMap newDMap()
          Create a new DMap object.
 DSet newDSet()
          Create a new DSet object.
 OQLQuery newOQLQuery()
          Create a new OQLQuery object.
 Transaction newTransaction()
          Create a Transaction object and associate it with the current thread.
(package private)  void setCurrentDatabase(DatabaseImpl curDB)
          Method declaration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newTransaction

public Transaction newTransaction()
Create a Transaction object and associate it with the current thread.

Specified by:
newTransaction in interface Implementation
Returns:
The newly created Transaction instance.
See Also:
Transaction

currentTransaction

public Transaction currentTransaction()
Get the current Transaction for the thread.

Specified by:
currentTransaction in interface Implementation
Returns:
The current Transaction object or null if there is none.
See Also:
Transaction

newDatabase

public Database newDatabase()
Create a new Database object.

Specified by:
newDatabase in interface Implementation
Returns:
The new Database object.
See Also:
Database

newOQLQuery

public OQLQuery newOQLQuery()
Create a new OQLQuery object.

Specified by:
newOQLQuery in interface Implementation
Returns:
The new OQLQuery object.
See Also:
OQLQuery

newDList

public DList newDList()
Create a new DList object.

Specified by:
newDList in interface Implementation
Returns:
The new DList object.
See Also:
DList

newDBag

public DBag newDBag()
Create a new DBag object.

Specified by:
newDBag in interface Implementation
Returns:
The new DBag object.
See Also:
DBag

newDSet

public DSet newDSet()
Create a new DSet object.

Specified by:
newDSet in interface Implementation
Returns:
The new DSet object.
See Also:
DSet

newDArray

public DArray newDArray()
Create a new DArray object.

Specified by:
newDArray in interface Implementation
Returns:
The new DArray object.
See Also:
DArray

newDMap

public DMap newDMap()
Create a new DMap object.

Specified by:
newDMap in interface Implementation
Returns:
The new DMap object.
See Also:
DMap

getObjectId

public java.lang.String getObjectId(java.lang.Object obj)
Get a String representation of the object's identifier. OJB returns the serialized Identity of the object.

Specified by:
getObjectId in interface Implementation
Parameters:
obj - The object whose identifier is being accessed.
Returns:
The object's identifier in the form of a String

getDatabase

public Database getDatabase(java.lang.Object obj)
Get the Database that contains the object obj.

Specified by:
getDatabase in interface Implementation
Parameters:
obj - The object.
Returns:
The Database that contains the object. If obj.getClass() is defined in the repository return current db else throw exception, as we can't tell where unknown classes reside

getInstance

public static OJB getInstance()
return singleton instance


getLogger

public static Logger getLogger()

setCurrentDatabase

void setCurrentDatabase(DatabaseImpl curDB)
Method declaration

Parameters:
curDB -


Authors: Thomas Mahler and others. (C) 2000, 2001.
All rights reserved. Published under the Gnu Public License.
http://objectbridge.sourceforge.net
Version: 0.8.375, 2002-04-04