|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.store.expression.ScalarExpression
org.jpox.store.expression.ObjectExpression
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).
Nested Class Summary |
Nested classes inherited from class org.jpox.store.expression.ScalarExpression |
ScalarExpression.DyadicOperator, ScalarExpression.ExpressionList, ScalarExpression.FieldExpression, ScalarExpression.IllegalArgumentTypeException, ScalarExpression.IllegalOperationException, ScalarExpression.MethodInvocationException, ScalarExpression.MonadicOperator, ScalarExpression.Operator |
Field Summary | |
protected ScalarExpression |
conditionExpr
|
Fields inherited from class org.jpox.store.expression.ScalarExpression |
aliasIdentifier, expressionList, FILTER, LOCALISER, lowestOperator, mapping, OP_ADD, OP_AND, OP_BETWEEN, OP_COM, OP_CONCAT, OP_DIV, OP_EQ, OP_GT, OP_GTEQ, OP_IN, OP_IS, OP_ISNOT, OP_LIKE, OP_LT, OP_LTEQ, OP_MOD, OP_MUL, OP_NEG, OP_NOT, OP_NOTEQ, OP_OR, OP_SUB, PROJECTION, qs, st, te |
Constructor Summary | |
protected |
ObjectExpression(QueryExpression qs)
|
|
ObjectExpression(QueryExpression qs,
JavaTypeMapping mapping,
LogicSetExpression te)
Constructor for an object expression, using the mapping of the field, and the expression for the table. |
|
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. |
|
ObjectExpression(QueryExpression qs,
ScalarExpression expr,
ScalarExpression conditionExpr,
LogicSetExpression te)
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; |
Method Summary | |
ScalarExpression |
accessField(java.lang.String subfieldName,
boolean innerJoin)
Access a normal field or a collection field in the object that this expression represents. |
void |
addOuterJoinSuffix(java.lang.String suffix)
Convenience method to add an outer join suffix. |
ScalarExpression |
cast(java.lang.Class castType)
Cast operator. |
BooleanExpression |
eq(ScalarExpression expr)
Equals operator. |
BooleanExpression |
in(ScalarExpression expr)
In expression. |
BooleanExpression |
instanceOf(ScalarExpression expr)
Method to return a constraint for restricting the field to just instances of a particular class. |
BooleanExpression |
noteq(ScalarExpression expr)
Not equals operator. |
void |
setFieldDefinition(java.lang.String fieldName,
java.lang.String fieldType)
Set the field which this expression was created from. |
void |
useIdentityFormOfPCMapping()
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. |
Methods inherited from class org.jpox.store.expression.ScalarExpression |
add, and, as, callMethod, com, div, encloseWithInParentheses, eor, equals, getAlias, getExpressionList, getLogicSetExpression, getMapping, getNonAliasExpression, getQueryExpression, gt, gteq, ior, lt, lteq, mod, mul, neg, not, sub, toStatementText, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected ScalarExpression conditionExpr
Constructor Detail |
protected ObjectExpression(QueryExpression qs)
public ObjectExpression(QueryExpression qs, JavaTypeMapping mapping, LogicSetExpression te)
qs
- The Query Statementmapping
- The mapping for the field whose object we are expressingte
- The expression for the table of the object.public ObjectExpression(QueryExpression qs, JavaTypeMapping mapping, LogicSetExpression te, JavaTypeMapping refMapping, LogicSetExpression teTarget, JavaTypeMapping selectMapping)
qs
- The Query Statementmapping
- The mapping for the field whose object we are expressingte
- The expression for the table of the objectrefMapping
- The mapping of the field in another table that we join toteTarget
- The expression for the other table that we are joining to.selectMapping
- The mapping that we should select in the other tablepublic ObjectExpression(QueryExpression qs, ScalarExpression expr, ScalarExpression conditionExpr, LogicSetExpression te)
qs
- the QueryExpressionexpr
- the expressionconditionExpr
- the conditional boolean expressionte
- the TableExpressionMethod Detail |
public void useIdentityFormOfPCMapping()
public void addOuterJoinSuffix(java.lang.String suffix)
suffix
- The suffixpublic ScalarExpression cast(java.lang.Class castType)
cast
in class ScalarExpression
castType
- The type we cast this object to
public BooleanExpression eq(ScalarExpression expr)
eq
in class ScalarExpression
expr
- The expression we compare with (the right-hand-side in the query)
public BooleanExpression noteq(ScalarExpression expr)
noteq
in class ScalarExpression
expr
- The expression we compare with (the right-hand-side in the query)
public BooleanExpression in(ScalarExpression expr)
ScalarExpression
expr
in
in class ScalarExpression
expr
- the right-hand expression
public ScalarExpression accessField(java.lang.String subfieldName, boolean innerJoin)
accessField
in class ScalarExpression
subfieldName
- the field to be accessed in this objectinnerJoin
- whether to inner join
public BooleanExpression instanceOf(ScalarExpression expr)
instanceOf
in class ScalarExpression
expr
- Expression for the class that we want instances of (a ClassExpression).
public void setFieldDefinition(java.lang.String fieldName, java.lang.String fieldType)
fieldName
- The fieldName to set.fieldType
- The fieldType to set
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |