SolarMetric Kodo JDO 3.1.6 generated on August 25 2004

kodo.jdbc.query
Class SQLPath

java.lang.Object
  |
  +--kodo.jdbc.query.SQLPath
All Implemented Interfaces:
kodo.jdbc.query.JDBCPath, JDBCValue, Path, Value

public class SQLPath
extends Object
implements kodo.jdbc.query.JDBCPath

A path represents a traversal into fields of a candidate object.


Constructor Summary
SQLPath(ClassMapping type)
          Return a path starting with the 'this' ptr.
SQLPath(ClassMapping candidate, kodo.jdbc.query.Variable var)
          Return a path starting from the given variable.
 
Method Summary
 void addVariableAction(kodo.jdbc.query.Variable var)
          Set the path as a binding of the given variable.
 void appendIsEmpty(SQLBuffer sql, KodoPersistenceManager pm)
          Append the SQL testing whether this value is empty to the given buffer.
 void appendIsNotNull(SQLBuffer sql, KodoPersistenceManager pm)
          Append the SQL testing whether this value is not null to the given buffer.
 void appendIsNull(SQLBuffer sql, KodoPersistenceManager pm)
          Append the SQL testing whether this value is null to the given buffer.
 void appendTo(SQLBuffer sql, int index, KodoPersistenceManager pm)
          Append the SQL for this value to the given buffer.
 void calculateValue(KodoPersistenceManager pm, Map params, JDBCValue other)
          Calculate and cache the SQL for this value.
 void castTo(Class type)
          Cast this value to the given type.
 void clearParameters()
          Clear parameter values held by this value or its subcomponents.
 void get(FieldMetaData field)
          Traverse into the given field of the current object, and update the current object to that field value.
 ClassMapping getClassMapping()
          Return the class mapping for this path.
 Object getDataStoreValue(Object val, KodoPersistenceManager pm)
          Transform the given value into its datastore equivalent.
 FieldMapping getFieldMapping()
          Return the field mapping for this path.
 Joins getJoins()
          Return the joins for this value.
 void getKey()
           
 ClassMetaData getMetaData()
          Return any associated persistent type.
 String getPath()
          Return the string of fields this path traverses.
 boolean hasVariable(kodo.jdbc.query.Variable var)
          Return true if this value uses the given variable.
 void initialize(KodoPersistenceManager pm, Select select, boolean nullTest)
          Initialize the value.
 boolean isUnaccessedVariable()
          Return true if this is a bound variable that has not been accessed after binding.
 boolean isVariable()
          Return true if this value is a variable.
 int length()
          Return the number of SQL elements in this value.
 Object load(Result res, JDBCStoreManager store, JDBCFetchConfiguration fetch)
          Load the data for this value.
 void select(Select sel, JDBCStoreManager store, JDBCFetchConfiguration fetch)
          Select the data for this value.
 void setContainsId(String id)
          If this path is part of a contains clause, then alias it to the proper contains id before initialization.
 void setMetaData(ClassMetaData meta)
          Associate a persistent type with this value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLPath

public SQLPath(ClassMapping type)
Return a path starting with the 'this' ptr.

SQLPath

public SQLPath(ClassMapping candidate,
               kodo.jdbc.query.Variable var)
Return a path starting from the given variable.
Method Detail

addVariableAction

public void addVariableAction(kodo.jdbc.query.Variable var)
Set the path as a binding of the given variable.

getMetaData

public ClassMetaData getMetaData()
Description copied from interface: Value
Return any associated persistent type.
Specified by:
getMetaData in interface Value

setMetaData

public void setMetaData(ClassMetaData meta)
Description copied from interface: Value
Associate a persistent type with this value.
Specified by:
setMetaData in interface Value

isVariable

public boolean isVariable()
Description copied from interface: Value
Return true if this value is a variable.
Specified by:
isVariable in interface Value

getClassMapping

public ClassMapping getClassMapping()
Return the class mapping for this path.

getFieldMapping

public FieldMapping getFieldMapping()
Return the field mapping for this path.

getPath

public String getPath()
Return the string of fields this path traverses.

isUnaccessedVariable

public boolean isUnaccessedVariable()
Return true if this is a bound variable that has not been accessed after binding. Useful for filters like "coll.contains (var) && var == null", which should really just act like "coll.contains (null)".

setContainsId

public void setContainsId(String id)
If this path is part of a contains clause, then alias it to the proper contains id before initialization.

get

public void get(FieldMetaData field)
Description copied from interface: Path
Traverse into the given field of the current object, and update the current object to that field value.
Specified by:
get in interface Path

getKey

public void getKey()
Specified by:
getKey in interface kodo.jdbc.query.JDBCPath

castTo

public void castTo(Class type)
Description copied from interface: JDBCValue
Cast this value to the given type.
Specified by:
castTo in interface JDBCValue

initialize

public void initialize(KodoPersistenceManager pm,
                       Select select,
                       boolean nullTest)
Description copied from interface: JDBCValue
Initialize the value. This method should recursively initialize any sub-values. It should also cache the Joins instance containing the joins for this value.
Specified by:
initialize in interface JDBCValue
Following copied from interface: kodo.jdbc.query.JDBCValue
Parameters:
pm - the persistence manager for the query
select - used to create Joins instances
nullTest - if true, then this value will be compared to null or tested for emptiness

calculateValue

public void calculateValue(KodoPersistenceManager pm,
                           Map params,
                           JDBCValue other)
Description copied from interface: JDBCValue
Calculate and cache the SQL for this value.
Specified by:
calculateValue in interface JDBCValue

length

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

appendTo

public void appendTo(SQLBuffer sql,
                     int index,
                     KodoPersistenceManager pm)
Description copied from interface: JDBCValue
Append the SQL for this value to the given buffer.
Specified by:
appendTo in interface JDBCValue

appendIsEmpty

public void appendIsEmpty(SQLBuffer sql,
                          KodoPersistenceManager pm)
Description copied from interface: JDBCValue
Append the SQL testing whether this value is empty to the given buffer.
Specified by:
appendIsEmpty in interface JDBCValue

appendIsNull

public void appendIsNull(SQLBuffer sql,
                         KodoPersistenceManager pm)
Description copied from interface: JDBCValue
Append the SQL testing whether this value is null to the given buffer.
Specified by:
appendIsNull in interface JDBCValue

appendIsNotNull

public void appendIsNotNull(SQLBuffer sql,
                            KodoPersistenceManager pm)
Description copied from interface: JDBCValue
Append the SQL testing whether this value is not null to the given buffer.
Specified by:
appendIsNotNull in interface JDBCValue

clearParameters

public void clearParameters()
Description copied from interface: JDBCValue
Clear parameter values held by this value or its subcomponents.
Specified by:
clearParameters in interface JDBCValue

getJoins

public Joins getJoins()
Description copied from interface: JDBCValue
Return the joins for this value. These joins should be created and cached during the JDBCValue.initialize(kodo.runtime.KodoPersistenceManager, kodo.jdbc.sql.Select, boolean) method. 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:
getJoins in interface JDBCValue

getDataStoreValue

public Object getDataStoreValue(Object val,
                                KodoPersistenceManager pm)
Description copied from interface: JDBCValue
Transform the given value into its datastore equivalent.
Specified by:
getDataStoreValue in interface JDBCValue

select

public void select(Select sel,
                   JDBCStoreManager store,
                   JDBCFetchConfiguration fetch)
Description copied from interface: JDBCValue
Select the data for this value.
Specified by:
select in interface JDBCValue

load

public Object load(Result res,
                   JDBCStoreManager store,
                   JDBCFetchConfiguration fetch)
            throws SQLException
Description copied from interface: JDBCValue
Load the data for this value.
Specified by:
load in interface JDBCValue

hasVariable

public boolean hasVariable(kodo.jdbc.query.Variable var)
Description copied from interface: JDBCValue
Return true if this value uses the given variable.
Specified by:
hasVariable in interface JDBCValue

SolarMetric Kodo JDO 3.1.6 generated on August 25 2004

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.