org.apache.openjpa.kernel.exps
Class Context

java.lang.Object
  extended by org.apache.openjpa.kernel.exps.Context
All Implemented Interfaces:
Serializable

public class Context
extends Object
implements Serializable

JPQL / Criteria Query Context

Since:
2.0
See Also:
Serialized Form

Field Summary
protected  int aliasCount
           
 Context cloneFrom
           
 Expression from
           
 ClassMetaData meta
           
 JPQLExpressionBuilder.ParsedJPQL parsed
           
 String schemaAlias
           
 Subquery subquery
           
 
Constructor Summary
Context(JPQLExpressionBuilder.ParsedJPQL parsed, Subquery subquery, Context parent)
           
 
Method Summary
 void addSchema(String id, ClassMetaData meta)
           
 void addSubselContext(Context sub)
          Register the subquery context in this context.
 void addVariable(String id, Value var)
           
 Context findContext(String alias)
          Given an alias find the context of its associated variable where it is defined.
 Value findVariable(String alias)
          Given an alias find the variable in JPQL contexts.
 Context getParent()
           
 ClassMetaData getSchema(String id)
           
 Map<String,ClassMetaData> getSchemas()
           
 Object getSelect()
          Returns the select associated with this context.
 Subquery getSubquery()
          Returns the subquery in this context.
 List<Context> getSubselContexts()
          Returns the subquery context.
 Value getVariable(String alias)
          Given an alias and return its associated variable.
 Map<String,Value> getVariables()
           
 ClassMetaData meta()
           
 int nextAlias()
          Returns next table alias to be created.
 void resetAliasCount()
          Reset alias count for prepared query cache
 String schemaAlias()
           
 void setSchemas(Map<String,ClassMetaData> schemas)
           
 void setSelect(Object select)
          Register the select for this context.
 void setSubquery(Subquery subquery)
           
 void setVariables(Map<String,Value> variables)
           
 Subquery subquery()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parsed

public final JPQLExpressionBuilder.ParsedJPQL parsed

meta

public ClassMetaData meta

schemaAlias

public String schemaAlias

subquery

public Subquery subquery

from

public Expression from

cloneFrom

public Context cloneFrom

aliasCount

protected int aliasCount
Constructor Detail

Context

public Context(JPQLExpressionBuilder.ParsedJPQL parsed,
               Subquery subquery,
               Context parent)
Method Detail

setSubquery

public void setSubquery(Subquery subquery)

meta

public ClassMetaData meta()

schemaAlias

public String schemaAlias()

subquery

public Subquery subquery()

nextAlias

public int nextAlias()
Returns next table alias to be created.

Returns:

resetAliasCount

public void resetAliasCount()
Reset alias count for prepared query cache


setSelect

public void setSelect(Object select)
Register the select for this context.

Parameters:
select -

getSelect

public Object getSelect()
Returns the select associated with this context.

Returns:

addSubselContext

public void addSubselContext(Context sub)
Register the subquery context in this context.

Parameters:
sub -

getSubselContexts

public List<Context> getSubselContexts()
Returns the subquery context.

Returns:

getSubquery

public Subquery getSubquery()
Returns the subquery in this context.

Returns:

getParent

public Context getParent()

addVariable

public void addVariable(String id,
                        Value var)

getVariables

public Map<String,Value> getVariables()

setVariables

public void setVariables(Map<String,Value> variables)

addSchema

public void addSchema(String id,
                      ClassMetaData meta)

getSchema

public ClassMetaData getSchema(String id)

getSchemas

public Map<String,ClassMetaData> getSchemas()

setSchemas

public void setSchemas(Map<String,ClassMetaData> schemas)

getVariable

public Value getVariable(String alias)
Given an alias and return its associated variable.

Parameters:
alias -
Returns:

findContext

public Context findContext(String alias)
Given an alias find the context of its associated variable where it is defined.

Parameters:
alias -
Returns:

findVariable

public Value findVariable(String alias)
Given an alias find the variable in JPQL contexts.

Parameters:
alias -
Returns:


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