| java.lang.Object org.jpox.store.expression.ScalarExpression org.jpox.store.expression.ObjectExpression
All known Subclasses: org.jpox.store.expression.ObjectLiteral,
ObjectExpression | public class ObjectExpression extends ScalarExpression (Code) | | Representation of an Object expression in a Query.
Let's take an example :-
We have classes A and B, and A contains a reference to B "b".
If we do a JDOQL query for class A of "b.someField == value" then
"b" is interpreted first and an ObjectExpression is created to represent
that object (of type B).
The expression has an associated TableExpression, and a list of
expressions which represent the datastore columns identifying the
object (the PK fields/columns).
version: $Revision: 1.59 $ |
Constructor Summary | |
protected | ObjectExpression(QueryExpression qs) | public | ObjectExpression(QueryExpression qs, JavaTypeMapping mapping, LogicSetExpression te) Constructor for an object expression, using the mapping of the field, and the expression for the table. | public | ObjectExpression(QueryExpression qs, JavaTypeMapping mapping, LogicSetExpression te, JavaTypeMapping refMapping, LogicSetExpression teTarget, JavaTypeMapping selectMapping) Constructor for an object expression, using the mapping of the field (which has no datastore columns),
the expression for its table, the mapping for a field in another table to join to, and the expression
for the other table. | public | ObjectExpression(QueryExpression qs, ScalarExpression expr, ScalarExpression conditionExpr, LogicSetExpression te) |
ObjectExpression | public ObjectExpression(QueryExpression qs, JavaTypeMapping mapping, LogicSetExpression te)(Code) | | Constructor for an object expression, using the mapping of the field, and the expression for the table.
Parameters: qs - The Query Statement Parameters: mapping - The mapping for the field whose object we are expressing Parameters: te - The expression for the table of the object. |
ObjectExpression | public ObjectExpression(QueryExpression qs, JavaTypeMapping mapping, LogicSetExpression te, JavaTypeMapping refMapping, LogicSetExpression teTarget, JavaTypeMapping selectMapping)(Code) | | Constructor for an object expression, using the mapping of the field (which has no datastore columns),
the expression for its table, the mapping for a field in another table to join to, and the expression
for the other table. This is for use in 2 situations :-
- a 1-1 bidirectional single-FK relation where one side has its FK stored in the other object,
so we need to left outer join to get that field.
- a 1-N bidirectional join table relation where the element side has to navigate via the
join table to get to the owner object.
Parameters: qs - The Query Statement Parameters: mapping - The mapping for the field whose object we are expressing Parameters: te - The expression for the table of the object Parameters: refMapping - The mapping of the field in another table that we join to Parameters: teTarget - The expression for the other table that we are joining to. Parameters: selectMapping - The mapping that we should select in the other table |
ObjectExpression | public ObjectExpression(QueryExpression qs, ScalarExpression expr, ScalarExpression conditionExpr, LogicSetExpression te)(Code) | | Construct an object expression conditioned to a boolean expression
If this expression is an operand of an operation with result type Boolean has the following semantic
if (conditionExpr == null )
return (otherExpression op expr);
else
return (otherExpression op expr) & conditionExpr;
Parameters: qs - the QueryExpression Parameters: expr - the expression Parameters: conditionExpr - the conditional boolean expression Parameters: te - the TableExpression |
accessField | public ScalarExpression accessField(String subfieldName, boolean innerJoin)(Code) | | Access a field in the object that this expression represents.
If the field is contained in a different table then will use the "innerJoin" input parameter
and make a join to the required table. If the field is a 1-1 relation and the current table holds the FK
then no join will be made.
Parameters: subfieldName - the field to be accessed in this object Parameters: innerJoin - whether to inner join The field expression representing the required field of this object |
addOuterJoinSuffix | public void addOuterJoinSuffix(String suffix)(Code) | | Convenience method to add an outer join suffix.
Particularly for use with Oracle (8) which uses syntax like table1.col1 = table2.col2 (+),
Parameters: suffix - The suffix |
cast | public ScalarExpression cast(Class castType)(Code) | | Cast operator. Called when the query contains "(type)obj" where "obj" is this object.
Parameters: castType - The type we cast this object to Scalar expression representing the cast object. |
eq | public BooleanExpression eq(ScalarExpression expr)(Code) | | Equals operator. Called when the query contains "obj == value" where "obj" is this object.
Parameters: expr - The expression we compare with (the right-hand-side in the query) Boolean expression representing the comparison. |
instanceOf | public BooleanExpression instanceOf(ScalarExpression expr)(Code) | | Method to return a constraint for restricting the field to just instances of a particular class.
Parameters: expr - Expression for the class that we want instances of (a ClassExpression). The expression for the instanceof clause |
noteq | public BooleanExpression noteq(ScalarExpression expr)(Code) | | Not equals operator. Called when the query contains "obj != value" where "obj" is this object.
Parameters: expr - The expression we compare with (the right-hand-side in the query) Boolean expression representing the comparison. |
setFieldDefinition | public void setFieldDefinition(String fieldName, String fieldType)(Code) | | Set the field which this expression was created from.
Parameters: fieldName - The fieldName to set. Parameters: fieldType - The fieldType to set |
useFirstDatastoreFieldOnly | void useFirstDatastoreFieldOnly()(Code) | | Method to change the expression to use only the first datastore field.
This is used where we want to use the expression in an aggregate and
only can use one datastore field. Package permission to prevent external access.
|
useIdentityFormOfPCMapping | public void useIdentityFormOfPCMapping()(Code) | | Convenience method for the case where the mapping being used is a PersistenceCapableMapping
and where we want to represent the identity instead of the object represented by that
mapping. This changes the mapping to use the id.
|
|
|