org.jpox.store
Interface FetchStatement

All Known Implementing Classes:
RDBMSFetchStatement

public interface FetchStatement

Representation of a statement to fetch a particular object.

Version:
$Revision: 1.13 $

Method Summary
 void andCondition(java.lang.String condition)
          Method to add an extra condition to the WHERE clause.
 java.lang.String referenceDatastoreField(DatastoreField col)
          Method to specify a column to be referenced.
 int select(DatastoreField col)
          Add a column to the SELECT clause.
 int select(java.lang.String expr)
          Adds an expression to the SELECT clause.
 int[] selectOuterJoin(JavaTypeMapping refMapping, JavaTypeMapping selectMapping, JavaTypeMapping refTypeMapping)
          Add column(s) to the SELECT clause using a LEFT OUTER JOIN to join to another table.
 int[] selectOuterJoin(JavaTypeMapping refMapping, JavaTypeMapping selectMapping, JavaTypeMapping refDiscrimMapping, java.lang.Object[] discrimValues)
          Add column(s) to the SELECT clause using a LEFT OUTER JOIN to join to another table.
 java.lang.String toString()
          Method to return the statement assuming no locking of rows.
 java.lang.String toString(boolean lock)
          Method to return the statement.
 

Method Detail

selectOuterJoin

public int[] selectOuterJoin(JavaTypeMapping refMapping,
                             JavaTypeMapping selectMapping,
                             JavaTypeMapping refDiscrimMapping,
                             java.lang.Object[] discrimValues)
Add column(s) to the SELECT clause using a LEFT OUTER JOIN to join to another table. Joins using the refMapping in the other table, and selects the columns of the selectMapping. A discriminator in the other table can be provided where this should be part of the join constraint.

Parameters:
refMapping - Mapping in the other table to join to.
selectMapping - Mapping of the field in the other table to select
refDiscrimMapping - Mapping for discriminator in the related table (optional)
discrimValues - Valid values for the discriminator in the related table (optional)
Returns:
The parameter position(s) of the column(s) in the statement.

selectOuterJoin

public int[] selectOuterJoin(JavaTypeMapping refMapping,
                             JavaTypeMapping selectMapping,
                             JavaTypeMapping refTypeMapping)
Add column(s) to the SELECT clause using a LEFT OUTER JOIN to join to another table. Joins using the refMapping in the other table, and selects the columns of the selectMapping. A reference type mapping can be provided where we need the reference mapping joining to a subclass table to define the correct type.

Parameters:
refMapping - Mapping in the other table to join to.
selectMapping - Mapping of the field in the other table to select
refTypeMapping - Mapping for subclass table for the related table (optional)
Returns:
The parameter position(s) of the column(s) in the statement.

select

public int select(DatastoreField col)
Add a column to the SELECT clause.

Parameters:
col - The column to add
Returns:
The parameter position of this column in the statement.

select

public int select(java.lang.String expr)
Adds an expression to the SELECT clause.

Parameters:
expr - the expr to add to the select clause
Returns:
The parameter position of this expression in the statement.

referenceDatastoreField

public java.lang.String referenceDatastoreField(DatastoreField col)
Method to specify a column to be referenced.

Parameters:
col - The column
Returns:
The column statement text

andCondition

public void andCondition(java.lang.String condition)
Method to add an extra condition to the WHERE clause.

Parameters:
condition - The condition

toString

public java.lang.String toString()
Method to return the statement assuming no locking of rows.

Returns:
The statement

toString

public java.lang.String toString(boolean lock)
Method to return the statement.

Parameters:
lock - Whether to lock the rows found by this SELECT
Returns:
The statement


Copyright © -2007 . All Rights Reserved.