org.apache.openjpa.jdbc.kernel.exps
Class Args

java.lang.Object
  extended by org.apache.openjpa.jdbc.kernel.exps.Args
All Implemented Interfaces:
Val, org.apache.openjpa.kernel.exps.Arguments, org.apache.openjpa.kernel.exps.Value

public class Args
extends java.lang.Object
implements Val, org.apache.openjpa.kernel.exps.Arguments

A list of arguments to a multi-argument function.

Author:
Abe White

Constructor Summary
Args(Val val1, Val val2)
          Constructor.
 
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.
 org.apache.openjpa.meta.ClassMetaData getMetaData()
           
 java.lang.Class getType()
           
 java.lang.Class[] getTypes()
           
 Val[] getVals()
           
 org.apache.openjpa.kernel.exps.Value[] getValues()
           
 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.
 boolean isVariable()
           
 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.
 void setImplicitType(java.lang.Class type)
           
 void setMetaData(org.apache.openjpa.meta.ClassMetaData meta)
           
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Args

public Args(Val val1,
            Val val2)
Constructor. Supply values being combined.

Method Detail

getValues

public org.apache.openjpa.kernel.exps.Value[] getValues()
Specified by:
getValues in interface org.apache.openjpa.kernel.exps.Arguments

getVals

public Val[] getVals()

getMetaData

public org.apache.openjpa.meta.ClassMetaData getMetaData()
Specified by:
getMetaData in interface org.apache.openjpa.kernel.exps.Value

setMetaData

public void setMetaData(org.apache.openjpa.meta.ClassMetaData meta)
Specified by:
setMetaData in interface org.apache.openjpa.kernel.exps.Value

isVariable

public boolean isVariable()
Specified by:
isVariable in interface org.apache.openjpa.kernel.exps.Value

getType

public java.lang.Class getType()
Specified by:
getType in interface org.apache.openjpa.kernel.exps.Value

getTypes

public java.lang.Class[] getTypes()

setImplicitType

public void setImplicitType(java.lang.Class type)
Specified by:
setImplicitType in interface org.apache.openjpa.kernel.exps.Value

initialize

public void initialize(Select sel,
                       JDBCStore store,
                       boolean nullTest)
Description copied from interface: Val
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.

Specified by:
initialize in interface Val
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

public Joins getJoins()
Description copied from interface: Val
Return the joins for this value. These joins should be created and cached during the Val.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.

Specified by:
getJoins in interface Val

toDataStoreValue

public java.lang.Object toDataStoreValue(java.lang.Object val,
                                         JDBCStore store)
Description copied from interface: Val
Return the datastore value of the given object in the context of this value.

Specified by:
toDataStoreValue in interface Val

select

public void select(Select sel,
                   JDBCStore store,
                   java.lang.Object[] params,
                   boolean pks,
                   JDBCFetchConfiguration fetch)
Description copied from interface: Val
Select the data for this value.

Specified by:
select in interface Val

selectColumns

public void selectColumns(Select sel,
                          JDBCStore store,
                          java.lang.Object[] params,
                          boolean pks,
                          JDBCFetchConfiguration fetch)
Description copied from interface: Val
Select just the columns for this value.

Specified by:
selectColumns in interface Val

groupBy

public void groupBy(Select sel,
                    JDBCStore store,
                    java.lang.Object[] params,
                    JDBCFetchConfiguration fetch)
Description copied from interface: Val
Group by this value.

Specified by:
groupBy in interface Val

orderBy

public void orderBy(Select sel,
                    JDBCStore store,
                    java.lang.Object[] params,
                    boolean asc,
                    JDBCFetchConfiguration fetch)
Description copied from interface: Val
Order by this value.

Specified by:
orderBy in interface Val

load

public java.lang.Object load(Result res,
                             JDBCStore store,
                             JDBCFetchConfiguration fetch)
Description copied from interface: Val
Load the data for this value.

Specified by:
load in interface Val

hasVariable

public boolean hasVariable(org.apache.openjpa.jdbc.kernel.exps.Variable var)
Description copied from interface: Val
Return true if this value uses the given variable.

Specified by:
hasVariable in interface Val

calculateValue

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

Specified by:
calculateValue in interface Val
other - the value being compared to, or null if not a comparison

clearParameters

public void clearParameters()
Description copied from interface: Val
Clear parameter values held by this value or its subcomponents. This method is called sometime after calculateValue.

Specified by:
clearParameters in interface Val

length

public int length()
Description copied from interface: Val
Return the number of SQL elements in this value.

Specified by:
length in interface Val

appendTo

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

Specified by:
appendTo in interface Val

appendIsEmpty

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

Specified by:
appendIsEmpty in interface Val

appendIsNotEmpty

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

Specified by:
appendIsNotEmpty in interface Val

appendSize

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

Specified by:
appendSize in interface Val

appendIsNull

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

Specified by:
appendIsNull in interface Val

appendIsNotNull

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

Specified by:
appendIsNotNull in interface Val


Copyright © 2006 Apache Software Foundation. All Rights Reserved.