org.apache.ojb.odmg
Class OJB

java.lang.Object
  extended byorg.apache.ojb.odmg.OJB
All Implemented Interfaces:
Implementation
Direct Known Subclasses:
OJBJ2EE_2

public class OJB
extends java.lang.Object
implements Implementation

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

Version:
$Id: OJB.java,v 1.14 2003/10/03 12:39:40 thma Exp $
Author:
Thomas Mahler, Matthew Baird, Armin Waibel

Method Summary
 Transaction currentTransaction()
          Get the current Transaction for the thread.
 org.apache.ojb.broker.util.configuration.Configurator getConfigurator()
          Gets the configurator.
 DatabaseImpl getCurrentDatabase()
           
 PBKey getCurrentPBKey()
           
 Database getDatabase(java.lang.Object obj)
          Returns the current used database or null.
static Implementation getInstance()
          Return new instance of the Implementation class.
 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.
 org.apache.ojb.odmg.oql.EnhancedOQLQuery newOQLQuery()
          Create a new OQLQuery object.
 Transaction newTransaction()
          Create a Transaction object and associate it with the current thread.
 void setConfigurator(org.apache.ojb.broker.util.configuration.Configurator configurator)
          Sets the configurator.
 void setImplicitLocking(boolean value)
          This method can be used to activate or deactivate the implicit locking mechanism for the current transaction.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Implementation getInstance()
Return new instance of the Implementation class.


getCurrentDatabase

public DatabaseImpl getCurrentDatabase()

getCurrentPBKey

public PBKey getCurrentPBKey()

getConfigurator

public org.apache.ojb.broker.util.configuration.Configurator getConfigurator()
Gets the configurator.

Returns:
Returns a Configurator

setConfigurator

public void setConfigurator(org.apache.ojb.broker.util.configuration.Configurator configurator)
Sets the configurator.

Parameters:
configurator - The configurator to set

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 org.apache.ojb.odmg.oql.EnhancedOQLQuery 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)
Returns the current used database or null.

Specified by:
getDatabase in interface Implementation
Parameters:
obj - The object.
Returns:
The Database that contains the object.

setImplicitLocking

public void setImplicitLocking(boolean value)
This method can be used to activate or deactivate the implicit locking mechanism for the current transaction. turning of implicit locking may improve performance but requires additional care to make sure all changed objects are properly registered to the transaction.

Parameters:
value - if set to true implicit locking is enabled, if false, implicit locking is disabled.


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14