org.apache.openjpa.jdbc.kernel.exps
Interface Val

All Superinterfaces:
org.apache.openjpa.kernel.exps.Value
All Known Implementing Classes:
Args

public interface Val
extends org.apache.openjpa.kernel.exps.Value

A Value represents any non-operator in a query filter, including constants, variables, and object fields.

Author:
Abe White

Method Summary
 void appendIsEmpty(SQLBuffer sql, Select sel, JDBCStore store, java.lang.Object[] params, JDBCFetchConfiguration fetch)
          Append the SQL testing whether this value is empty to the given buffer.
 void appendIsNotEmpty(SQLBuffer sql, Select sel, JDBCStore store, java.lang.Object[] params, JDBCFetchConfiguration fetch)
          Append the SQL testing whether this value is not empty to the given buffer.
 void appendIsNotNull(SQLBuffer sql, Select sel, JDBCStore store, java.lang.Object[] params, JDBCFetchConfiguration fetch)
          Append the SQL testing whether this value is not null to the given buffer.
 void appendIsNull(SQLBuffer sql, Select sel, JDBCStore store, java.lang.Object[] params, JDBCFetchConfiguration fetch)
          Append the SQL testing whether this value is null to the given buffer.
 void appendSize(SQLBuffer sql, Select sel, JDBCStore store, java.lang.Object[] params, JDBCFetchConfiguration fetch)
          Append the SQL checking the size of this value.
 void appendTo(SQLBuffer sql, int index, Select sel, JDBCStore store, java.lang.Object[] params, JDBCFetchConfiguration fetch)
          Append the indexth SQL element to the given buffer.
 void calculateValue(Select sel, JDBCStore store, java.lang.Object[] params, Val other, JDBCFetchConfiguration fetch)
          Calculate and cache the SQL for this value.
 void clearParameters()
          Clear parameter values held by this value or its subcomponents.
 Joins getJoins()
          Return the joins for this value.
 void groupBy(Select sel, JDBCStore store, java.lang.Object[] params, JDBCFetchConfiguration fetch)
          Group by this value.
 boolean hasVariable(org.apache.openjpa.jdbc.kernel.exps.Variable var)
          Return true if this value uses the given variable.
 void initialize(Select sel, JDBCStore store, boolean nullTest)
          Initialize the value.
 int length()
          Return the number of SQL elements in this value.
 java.lang.Object load(Result res, JDBCStore store, JDBCFetchConfiguration fetch)
          Load the data for this value.
 void orderBy(Select sel, JDBCStore store, java.lang.Object[] params, boolean asc, JDBCFetchConfiguration fetch)
          Order by this value.
 void select(Select sel, JDBCStore store, java.lang.Object[] params, boolean pks, JDBCFetchConfiguration fetch)
          Select the data for this value.
 void selectColumns(Select sel, JDBCStore store, java.lang.Object[] params, boolean pks, JDBCFetchConfiguration fetch)
          Select just the columns for this value.
 java.lang.Object toDataStoreValue(java.lang.Object val, JDBCStore store)
          Return the datastore value of the given object in the context of this value.
 
Methods inherited from interface org.apache.openjpa.kernel.exps.Value
getMetaData, getType, isVariable, setImplicitType, setMetaData
 

Method Detail

initialize

void initialize(Select sel,
                JDBCStore store,
                boolean nullTest)
Initialize the value. This method should recursively initialize any sub-values. It should also cache the Joins instance containing the joins for this value. No additional joins should be made after this call. The parent expression might modify these joins during its own initialization so that common joins are moved up the expression tree. These joins should not be included in the SQL appended through any of the append methods.

Parameters:
sel - used to create Joins instances
store - the store manager for the query
nullTest - if true, then this value will be compared to null or tested for emptiness

getJoins

Joins getJoins()
Return the joins for this value. These joins should be created and cached during the initialize(org.apache.openjpa.jdbc.sql.Select, org.apache.openjpa.jdbc.kernel.JDBCStore, boolean) method. The parent expression might modify these joins during its own initialization so that common joins are moved up the expression tree.


toDataStoreValue

java.lang.Object toDataStoreValue(java.lang.Object val,
                                  JDBCStore store)
Return the datastore value of the given object in the context of this value.


select

void select(Select sel,
            JDBCStore store,
            java.lang.Object[] params,
            boolean pks,
            JDBCFetchConfiguration fetch)
Select the data for this value.


selectColumns

void selectColumns(Select sel,
                   JDBCStore store,
                   java.lang.Object[] params,
                   boolean pks,
                   JDBCFetchConfiguration fetch)
Select just the columns for this value.


groupBy

void groupBy(Select sel,
             JDBCStore store,
             java.lang.Object[] params,
             JDBCFetchConfiguration fetch)
Group by this value.


orderBy

void orderBy(Select sel,
             JDBCStore store,
             java.lang.Object[] params,
             boolean asc,
             JDBCFetchConfiguration fetch)
Order by this value.


load

java.lang.Object load(Result res,
                      JDBCStore store,
                      JDBCFetchConfiguration fetch)
                      throws java.sql.SQLException
Load the data for this value.

Throws:
java.sql.SQLException

hasVariable

boolean hasVariable(org.apache.openjpa.jdbc.kernel.exps.Variable var)
Return true if this value uses the given variable.


calculateValue

void calculateValue(Select sel,
                    JDBCStore store,
                    java.lang.Object[] params,
                    Val other,
                    JDBCFetchConfiguration fetch)
Calculate and cache the SQL for this value. This method is called before length or any append methods.

Parameters:
other - the value being compared to, or null if not a comparison

clearParameters

void clearParameters()
Clear parameter values held by this value or its subcomponents. This method is called sometime after calculateValue.


length

int length()
Return the number of SQL elements in this value.


appendTo

void appendTo(SQLBuffer sql,
              int index,
              Select sel,
              JDBCStore store,
              java.lang.Object[] params,
              JDBCFetchConfiguration fetch)
Append the indexth SQL element to the given buffer.


appendIsEmpty

void appendIsEmpty(SQLBuffer sql,
                   Select sel,
                   JDBCStore store,
                   java.lang.Object[] params,
                   JDBCFetchConfiguration fetch)
Append the SQL testing whether this value is empty to the given buffer.


appendIsNotEmpty

void appendIsNotEmpty(SQLBuffer sql,
                      Select sel,
                      JDBCStore store,
                      java.lang.Object[] params,
                      JDBCFetchConfiguration fetch)
Append the SQL testing whether this value is not empty to the given buffer.


appendSize

void appendSize(SQLBuffer sql,
                Select sel,
                JDBCStore store,
                java.lang.Object[] params,
                JDBCFetchConfiguration fetch)
Append the SQL checking the size of this value.


appendIsNull

void appendIsNull(SQLBuffer sql,
                  Select sel,
                  JDBCStore store,
                  java.lang.Object[] params,
                  JDBCFetchConfiguration fetch)
Append the SQL testing whether this value is null to the given buffer.


appendIsNotNull

void appendIsNotNull(SQLBuffer sql,
                     Select sel,
                     JDBCStore store,
                     java.lang.Object[] params,
                     JDBCFetchConfiguration fetch)
Append the SQL testing whether this value is not null to the given buffer.



Copyright © 2006 Apache Software Foundation. All Rights Reserved.