org.tentackle.db
Class DbOperation

java.lang.Object
  extended by org.tentackle.db.DbOperation
Direct Known Subclasses:
AppDbOperation

public class DbOperation
extends Object

A DbOperation provides methods that are not part of DbObjects and is associated to a Db-connection. Complex transactions are usually DbOperations. DbOperations are remote capabable.

Author:
harald

Constructor Summary
DbOperation(Db db)
          Creates a db operation.
 
Method Summary
 Db getDb()
          Get the logical db connection for this operation.
 DbOperationRemoteDelegate getRemoteDelegate()
          Gets the delegate for remote connections.
Each class has its own delegate.
 DbOperationRemoteDelegate getRemoteDelegate(Db db)
          Gets the RemoteDelegate for the class and db.
 int getRemoteDelegateId(Db db)
          Gets the delegateId of the class, i.e.
 void setDb(Db db)
          Sets the logical db connection for this operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbOperation

public DbOperation(Db db)
Creates a db operation.

Parameters:
db - the logical db connection
Method Detail

setDb

public void setDb(Db db)
Sets the logical db connection for this operation.

Parameters:
db - the db connection

getDb

public Db getDb()
Get the logical db connection for this operation.

Returns:
the db connection

getRemoteDelegate

public DbOperationRemoteDelegate getRemoteDelegate()
Gets the delegate for remote connections.
Each class has its own delegate.

Returns:
the delegate for this object

getRemoteDelegateId

public int getRemoteDelegateId(Db db)
Gets the delegateId of the class, i.e. subclass of DbOperation. If the remoteDelegateId is 0, it will be prepared The delegateId is unique for each class. It is valid only in remote connections and is the same for all remote Db's. The RMI-server creates a delegate for each subclass of DbOperation (DbOperationRemoteDelegateImpl resp.)

Parameters:
db - the db connection
Returns:
the delegate id

getRemoteDelegate

public DbOperationRemoteDelegate getRemoteDelegate(Db db)
Gets the RemoteDelegate for the class and db.

Parameters:
db - the db connection
Returns:
the delegate


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de