com.odi.coll
Class BoundQuery

java.lang.Object
  |
  +--com.odi.jcpp.CPlusPlus
        |
        +--com.odi.coll.BoundQuery
All Implemented Interfaces:
IPersistent

public abstract class BoundQuery
extends CPlusPlus

A BoundQuery object represents a Query plus bindings for the values of the free variables. Every BoundQuery object is a transient Java peer object.

Call bind() on the bound query until values for all its free variables are specified. Then call Collection.query() and specify the bound query. After you call Collection.query(), you cannot modify the values associated with the bound query. At this point, the bound query is considered to be fully bound.

When you are finished with a BoundQuery object, call ObjectStore.destroy() on it to free the C++ transient storage. The application accesses the BoundQuery object through a Java peer object and the associated C++ object is not automatically garbage collected. You must explicitly delete it.


Constructor Summary
protected BoundQuery()
          Create a hollow BoundQuery object
 
Method Summary
abstract  BoundQuery bind(java.lang.String variable, int value)
          Binds the specified free variable to the int value.
abstract  BoundQuery bind(java.lang.String variable, long value)
          Bind the specified free variable to the long value.
abstract  BoundQuery bind(java.lang.String variable, java.lang.Object value)
          Bind the specified free variable to the Object value.
abstract  BoundQuery bind(java.lang.String variable, java.lang.String value)
          Bind the specified free variable to the String value.
static BoundQuery create(Query query)
          Creates a BoundQuery object.
 
Methods inherited from class com.odi.jcpp.CPlusPlus
delete, getTransientCluster, getTransientDatabase, getTransientSegment, noteJavaCppClassAssociation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.odi.IPersistent
clearContents, flushContents, initializeContents, ODIgetRef, ODIgetState, ODIsetRef, ODIsetState
 

Constructor Detail

BoundQuery

protected BoundQuery()
Create a hollow BoundQuery object
Method Detail

create

public static BoundQuery create(Query query)
Creates a BoundQuery object.
Parameters:
query - The Query object.

Returns:
The new BoundQuery object.

bind

public abstract BoundQuery bind(java.lang.String variable,
                                int value)
Binds the specified free variable to the int value.
Parameters:
variable - The name of a free variable in the query string of the underlying query.
value - The value for the free variable.
Returns:
This BoundQuery object.
Throws:
CollectionException - If the bound query is already fully bound.

bind

public abstract BoundQuery bind(java.lang.String variable,
                                long value)
Bind the specified free variable to the long value.
Parameters:
variable - The name of a free variable in the query string of the underlying query.
value - The value for the free variable.
Returns:
This BoundQuery object.
Throws:
CollectionException - If the bound query is already fully bound.

bind

public abstract BoundQuery bind(java.lang.String variable,
                                java.lang.String value)
Bind the specified free variable to the String value.
Parameters:
variable - The name of a free variable in the query string of the underlying query.
value - The value for the free variable.
Returns:
This BoundQuery object.
Throws:
CollectionException - If the bound query is already fully bound.

bind

public abstract BoundQuery bind(java.lang.String variable,
                                java.lang.Object value)
Bind the specified free variable to the Object value. The value must be a persistent object.
Parameters:
variable - The name of a free variable in the query string of the underlying query.
value - The value for the free variable.
Returns:
This BoundQuery object.
Throws:
CollectionException - If the bound query is already fully bound.
ObjectNotPersistentException - If the location is not already a persistent object. Possibly the application should call ObjectStore.migrate.
ObjectNotPersistenceCapableException - If the location is an object of a class that's not persistence-capable.


Copyright 2004 Progress Software Corporation. All rights reserved.