Methods Summary |
---|
public oracle.toplink.essentials.expressions.Expression | addToExpression(oracle.toplink.essentials.expressions.Expression parentExpression, oracle.toplink.essentials.internal.parsing.GenerationContext context)
if (isCollectionAttribute()) {
//special case for NOT MEMBER OF
if (context.hasMemberOfNode()) {
return parentExpression.noneOf(name, new ExpressionBuilder().equal(context.getMemberOfNode().getLeftExpression()));
}
return outerJoin ? parentExpression.anyOfAllowingNone(name) :
parentExpression.anyOf(name);
} else {
// check whether collection attribute is required
if (requiresCollectionAttribute()) {
throw EJBQLException.invalidCollectionMemberDecl(
context.getParseTreeContext().getQueryInfo(),
getLine(), getColumn(), name);
}
if (context.shouldUseOuterJoins() || isOuterJoin()) {
return parentExpression.getAllowingNull(name);
} else {
return parentExpression.get(name);
}
}
|
public java.lang.String | getAsString()INTERNAL
Get the string representation of this node.
return getAttributeName();
|
public java.lang.String | getAttributeName()
return name;
|
public oracle.toplink.essentials.mappings.DatabaseMapping | getMapping()
return mapping;
|
public boolean | isAttributeNode()INTERNAL
Is this node an AttributeNode
return true;
|
public boolean | isCollectionAttribute()
DatabaseMapping mapping = getMapping();
return (mapping != null) && mapping.isCollectionMapping();
|
public boolean | isOuterJoin()
return outerJoin;
|
public oracle.toplink.essentials.internal.parsing.Node | qualifyAttributeAccess(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)INTERNAL
If called this AttributeNode represents an unqualified field access.
The method returns a DotNode representing a qualified field access with
the base variable as left child node and the attribute as right child
node.
return (Node)context.getNodeFactory().newQualifiedAttribute(
getLine(), getColumn(), context.getBaseVariable(), name);
|
public boolean | requiresCollectionAttribute()
return requiresCollectionAttribute;
|
public java.lang.Class | resolveClass(oracle.toplink.essentials.internal.parsing.GenerationContext context, java.lang.Class ownerClass)resolveClass: Answer the class for the mapping associated with the my variableName in the ownerClass.
Answer null if the node represents a mapping that doesn't exist
DatabaseMapping mapping;
mapping = resolveMapping(context, ownerClass);
// if we are working with a direct-to-field, or the mapping's null,
// return the owner class
// Returning the ownerClass when the mapping is null delegates error handling
// to the query rather than me
if ((mapping == null) || (mapping.isDirectToFieldMapping())) {
return ownerClass;
}
ClassDescriptor descriptor = mapping.getReferenceDescriptor();
return (descriptor==null) ? null : descriptor.getJavaClass();
//return mapping.getReferenceDescriptor().getJavaClass();
|
public oracle.toplink.essentials.mappings.DatabaseMapping | resolveMapping(oracle.toplink.essentials.internal.parsing.GenerationContext context, java.lang.Class ownerClass)resolveMapping: Answer the mapping which corresponds to my variableName.
ClassDescriptor descriptor = context.getSession().getDescriptor(ownerClass);
return (descriptor==null) ? null : descriptor.getMappingForAttributeName(getAttributeName());
|
public void | setAttributeName(java.lang.String name)
this.name = name;
|
public void | setMapping(oracle.toplink.essentials.mappings.DatabaseMapping mapping)
this.mapping = mapping;
|
public void | setOuterJoin(boolean outerJoin)
this.outerJoin = outerJoin;
|
public void | setRequiresCollectionAttribute(boolean requiresCollectionAttribute)
this.requiresCollectionAttribute = requiresCollectionAttribute;
|
public java.lang.String | toString(int indent)
StringBuffer buffer = new StringBuffer();
toStringIndent(indent, buffer);
buffer.append(toStringDisplayName() + "[" + getAttributeName() + "]");
return buffer.toString();
|
public void | validate(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)INTERNAL
Validate the current node and calculates its type.
// The type is calculated in the parent DotNode.
|