org.apache.openjpa.kernel.exps
Class CandidatePath

java.lang.Object
  extended by org.apache.openjpa.kernel.exps.Val
      extended by org.apache.openjpa.kernel.exps.CandidatePath
All Implemented Interfaces:
Serializable, Path, Value
Direct Known Subclasses:
PCPath, ValuePath

public class CandidatePath
extends Val
implements Path

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

Author:
Abe White
See Also:
Serialized Form

Field Summary
protected  LinkedList _actions
           
protected  String _correlationVar
           
 
Constructor Summary
CandidatePath()
           
 
Method Summary
 void castTo(Class type)
          Cast this path to the given type.
 boolean equals(Object other)
           
protected  Object eval(Object candidate, Object orig, StoreContext ctx, Object[] params)
          Return this value for the given candidate.
 void get(FieldMetaData field, boolean nullTraversal)
          Traverse into the given field of the current object, and update the current object to that field value.
 void get(FieldMetaData fmd, XMLMetaData meta)
          Traverse into the given field that maps to xml column, and update the current object to that field value.
 void get(XMLMetaData meta, String name)
          Traverse into the gevin xpath name of the current object, and update the current object to that xpath field.
protected  Class getCandidateType()
           
 String getCorrelationVar()
           
 String getSchemaAlias()
           
 Class getType()
          Return the expected type for this value, or Object if the type is unknown.
 XMLMetaData getXmlMapping()
          Return the current XPath's xmlmapping metadata.
 int hashCode()
           
 FieldMetaData last()
          Return the last field in the path, or null if the path does not not contain a final field.
 void setImplicitType(Class type)
          Set the implicit type of the value, based on how it is used in the filter.
 void setSchemaAlias(String schemaAlias)
          Set the schema alias (the identification variable) this path is begin with.
 void setSubqueryContext(Context conext, String correlationVar)
           
 
Methods inherited from class org.apache.openjpa.kernel.exps.Val
acceptVisit, eval, evaluate, evaluate, getAlias, getMetaData, getName, getPath, getSelectAs, isAggregate, isVariable, isXPath, setAlias, setMetaData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.openjpa.kernel.exps.Value
acceptVisit, getAlias, getMetaData, getName, getPath, getSelectAs, isAggregate, isVariable, isXPath, setAlias, setMetaData
 

Field Detail

_actions

protected LinkedList _actions

_correlationVar

protected String _correlationVar
Constructor Detail

CandidatePath

public CandidatePath()
Method Detail

get

public void get(FieldMetaData field,
                boolean nullTraversal)
Traverse into the given field of the current object, and update the current object to that field value.

Specified by:
get in interface Path
nullTraversal - if true, allow traversal through a null field

getType

public Class getType()
Description copied from interface: Value
Return the expected type for this value, or Object if the type is unknown.

Specified by:
getType in interface Value

getCandidateType

protected Class getCandidateType()

setImplicitType

public void setImplicitType(Class type)
Description copied from interface: Value
Set the implicit type of the value, based on how it is used in the filter. This method is only called on values who return Object from Value.getType().

Specified by:
setImplicitType in interface Value

last

public FieldMetaData last()
Description copied from interface: Path
Return the last field in the path, or null if the path does not not contain a final field.

Specified by:
last in interface Path

castTo

public void castTo(Class type)
Cast this path to the given type.


eval

protected Object eval(Object candidate,
                      Object orig,
                      StoreContext ctx,
                      Object[] params)
Description copied from class: Val
Return this value for the given candidate.

Specified by:
eval in class Val

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

get

public void get(FieldMetaData fmd,
                XMLMetaData meta)
Description copied from interface: Path
Traverse into the given field that maps to xml column, and update the current object to that field value.

Specified by:
get in interface Path
Parameters:
fmd - field maps to xml column
meta - associated xml mapping

get

public void get(XMLMetaData meta,
                String name)
Description copied from interface: Path
Traverse into the gevin xpath name of the current object, and update the current object to that xpath field.

Specified by:
get in interface Path

getXmlMapping

public XMLMetaData getXmlMapping()
Description copied from interface: Path
Return the current XPath's xmlmapping metadata.

Specified by:
getXmlMapping in interface Path
Returns:
Return xmlmapping

setSchemaAlias

public void setSchemaAlias(String schemaAlias)
Description copied from interface: Path
Set the schema alias (the identification variable) this path is begin with.

Specified by:
setSchemaAlias in interface Path

getSchemaAlias

public String getSchemaAlias()
Specified by:
getSchemaAlias in interface Path

setSubqueryContext

public void setSubqueryContext(Context conext,
                               String correlationVar)
Specified by:
setSubqueryContext in interface Path

getCorrelationVar

public String getCorrelationVar()
Specified by:
getCorrelationVar in interface Path


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.