com.ibm.pdq.runtime

Enum HeterogeneousBatchKind

  1. java.lang.Object
  2. extended byjava.lang.Enum<HeterogeneousBatchKind>
  3. extended bycom.ibm.pdq.runtime.HeterogeneousBatchKind
All implemented interfaces:
Serializable, Comparable<HeterogeneousBatchKind>

public enum HeterogeneousBatchKind
extends Enum<HeterogeneousBatchKind>
Indicates for an instance of Data that SQL statements are being executed immediately, or that a batch for a heterogeneous update with parameters is being created.

pureQuery supports three types of batching of SQL statements: homogeneous batches, heterogeneous batches without parameters, and heterogeneous updates with parameters. See the pureQuery Runtime documentation for a full description of the different types of batching in pureQuery. HeterogeneousBatchKind is used for heterogeneous updates with parameters.

pureQuery performs heterogeneous updates with parameters by queueing INSERT, UPDATE, MERGE, and DELETE SQL statements in memory for a particular instance of Data, and then executing the queued statements in one network trip. The implementation classes that the pureQuery Generator creates for user-supplied interfaces of annotated methods implement the user-provided interfaces, as well as the Data interface. See the pureQuery Runtime documentation for an explanation of how to perform heterogeneous batches with parameters when using the annotated-method programming style.

Calling data.startBatch (HeterogeneousBatchKind.heterogeneousModify__) starts a batch for a heterogeneous update with parameters for the instance of Data. INSERT, UPDATE, MERGE, and DELETE SQL statement are then queued in the batch by calling pureQuery annotated and inline methods in the instance of Data. If an attempt is made to add SQL statements other than INSERT, UPDATE, MERGE, and DELETE to the batch (by calling methods that excute SQL statements that are not INSERT, UPDATE, MERGE, or DELETE), an exception is thrown, the current batch is cleared, and none of the SQL statements are executed. When all of the necessary SQL statements have been added to the batch, the batch can be executed by calling data.endBatch().

Calling data.startBatch(HeterogeneousBatchKind.heterogeneousModify__) starts a batch for data. Calling data.getBatchKind() returns either heterogeneousNone__, to indicate that no heterogeneous batch with parameters is being created and that SQL statements are being executed immediately, or it returns heterogeneousModify__, to indicate that SQL statements executed in pureQuery inline and annotated methods are being queued in a heterogeneous batch with parameters.


Enum Constant Summary

Enum Constant and Description
heterogeneousMixed__
For future enhancement.
heterogeneousModify__
Indicates the state of an instance of Data in which INSERT, UPDATE, MERGE, and DELETE SQL statements are queued to be to be executed as a heterogeneous update with parameters.
heterogeneousNone__
Indicates the state of an instance of Data in which SQL statements are executed immediately (that is, no SQL statements are being queued to be executed as a heterogeneous update with parameters).
heterogeneousQuery__
For future enhancement.

Method Summary

Modifier and Type Method and Description
  1. static
  2. HeterogeneousBatchKind
valueOf(String name)
Returns the enum constant of this type with the specified name.
  1. static
  2. HeterogeneousBatchKind[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

Enum Constant Detail

heterogeneousMixed__

public static final HeterogeneousBatchKind heterogeneousMixed__
For future enhancement.

heterogeneousModify__

public static final HeterogeneousBatchKind heterogeneousModify__
Indicates the state of an instance of Data in which INSERT, UPDATE, MERGE, and DELETE SQL statements are queued to be to be executed as a heterogeneous update with parameters.

This state is entered for an instance of Data when a batch for the update is created by calling data.startBatch(HeterogeneousBatchKind.heterogeneousModify__). This state is exited when the batch is executed by calling data.endBatch().

See Also:

heterogeneousNone__

public static final HeterogeneousBatchKind heterogeneousNone__
Indicates the state of an instance of Data in which SQL statements are executed immediately (that is, no SQL statements are being queued to be executed as a heterogeneous update with parameters).

This state is the default state for an instance of Data. Calling data.startBatch(HeterogeneousBatchKind.heterogeneousModify__) for the instance causes a switch to the heterogeneousModify__ state by starting a batch for a heterogeneous update with parameters. Executing the batch by calling data.endBatch() returns the instance to the heterogeneousNone__ state.

See Also:

heterogeneousQuery__

public static final HeterogeneousBatchKind heterogeneousQuery__
For future enhancement.

Method Detail

valueOf

public static HeterogeneousBatchKind valueOf(
String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

values

public static HeterogeneousBatchKind[] values(
)
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (HeterogeneousBatchKind c : HeterogeneousBatchKind.values())   
System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared