org.apache.ojb.odmg
Interface ImplementationExt

All Superinterfaces:
Implementation
All Known Implementing Classes:
ImplementationImpl, ImplementationJTAImpl

public interface ImplementationExt
extends Implementation

Offers useful none odmg-standard methods of the odmg Implementation interface.

Note: All listed methods are not part of the standard ODMG-api - they are special (proprietary) OJB extensions.

Version:
$Id: ImplementationExt.java 365232 2005-12-21 22:36:07Z tomdz $

Method Summary
 java.lang.Class getOqlCollectionClass()
          The used collection type class returned by OQL queries.
 boolean isImpliciteWriteLocks()
          Is true when implicite write locks are enabled.
 boolean isImplicitLocking()
          Returns true if the global implicit locking is enabled for this Implementation instance, else false.
 boolean isOrdering()
          Returns true if OJB's ordering algorithm is enabled.
 void setImpliciteWriteLocks(boolean impliciteWriteLocks)
          If the OJB implicit locking feature (see TransactionExt.setImplicitLocking(boolean)) is enabled, this define the lock type of all implicit locked objects.
 void setImplicitLocking(boolean impliciteLocking)
          Set the global property implicit locking.
 void setOqlCollectionClass(java.lang.Class oqlCollectionClass)
          Set the used collection type class returned by OQL queries.
 void setOrdering(boolean ordering)
          Disable/enable OJB's ordering algorithm when insert, update, delete a bunch of objects within a transaction.
 
Methods inherited from interface org.odmg.Implementation
currentTransaction, getDatabase, getObjectId, newDArray, newDatabase, newDBag, newDList, newDMap, newDSet, newOQLQuery, newTransaction
 

Method Detail

getOqlCollectionClass

java.lang.Class getOqlCollectionClass()
The used collection type class returned by OQL queries.

Returns:
The collection class type
See Also:
OQLQuery.execute(), OQLQuery.execute()

setOqlCollectionClass

void setOqlCollectionClass(java.lang.Class oqlCollectionClass)
Set the used collection type class returned by OQL queries.

NOTE: Each specified class must implement interface ManageableCollection to work proper with OJB.

Parameters:
oqlCollectionClass - The collection class used in OQL queries.

setImpliciteWriteLocks

void setImpliciteWriteLocks(boolean impliciteWriteLocks)
If the OJB implicit locking feature (see TransactionExt.setImplicitLocking(boolean)) is enabled, this define the lock type of all implicit locked objects.

If set to true, acquiring a write-lock on a given object x implies write locks on all implicit locked objects.
If set to false, in any case implicit read-locks are acquired. Acquiring a read- or write lock on x thus allways results in implicit read-locks on all associated objects.

Parameters:
impliciteWriteLocks - If true implicit write locks will enabled.

isImpliciteWriteLocks

boolean isImpliciteWriteLocks()
Is true when implicite write locks are enabled.

Returns:
true when implicit write locks are enabled.
See Also:
setImpliciteWriteLocks(boolean)

setImplicitLocking

void setImplicitLocking(boolean impliciteLocking)
Set the global property implicit locking. This method can be used to activate or deactivate the global implicit locking mechanism.
If set true OJB implicitly locks objects to ODMG transactions after performing OQL queries. Also if implicit locking is used locking objects is recursive, that is associated objects are also locked. If ImplicitLocking is set to 'false', no locks are obtained in OQL queries, lookup objects and there is also no recursive locking.

However it's possible to set this value only for the current used Transaction using TransactionExt.setImplicitLocking(boolean) and to detect the implicit locking state of the used transaction instance call TransactionExt.isImplicitLocking().
Turning off implicit locking may improve performance but requires additional care to make sure that all changed objects are properly registered to the transaction.

Parameters:
impliciteLocking - If set true implicit locking is enabled, if false, implicit locking is disabled.

isImplicitLocking

boolean isImplicitLocking()
Returns true if the global implicit locking is enabled for this Implementation instance, else false.
Important: The returned value is the global used setting for all Transaction.lock(Object, int) calls.
However it's possible to set this value only for the current used Transaction using TransactionExt.setImplicitLocking(boolean) and to detect the implicit locking state of the used transaction instance call TransactionExt.isImplicitLocking().

Returns:
true if the global property implicit lockingtrue is enabled.
See Also:
setImplicitLocking(boolean)

isOrdering

boolean isOrdering()
Returns true if OJB's ordering algorithm is enabled.

See Also:
setOrdering(boolean)

setOrdering

void setOrdering(boolean ordering)
Disable/enable OJB's ordering algorithm when insert, update, delete a bunch of objects within a transaction. The ordering algorithm try to calculate the correct order of the modified/new persistent objects to prevent problems on commit of the transaction.
If the used databases support 'deferred checks' it's recommended to use this feature and to disable OJB's object ordering.

However it's possible to set this value only for the current used Transaction using TransactionExt.setOrdering(boolean)

Parameters:
ordering - If true OJB's ordering algorithm is used.


(C) 2002 - 2006 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