Methods Summary |
---|
public void | addConstructorItem(java.lang.Object theNode)INTERNAL
Add an Order By Item to this node
constructorItems.add(theNode);
|
public void | applyToQuery(oracle.toplink.essentials.queryframework.ObjectLevelReadQuery theQuery, oracle.toplink.essentials.internal.parsing.GenerationContext context)INTERNAL
Apply this node to the passed query
if (theQuery instanceof ReportQuery) {
SelectGenerationContext selectContext = (SelectGenerationContext)context;
ReportQuery reportQuery = (ReportQuery)theQuery;
reportQuery.beginAddingConstructorArguments(
getConstructorClass(context.getParseTreeContext()));
for (Iterator i = constructorItems.iterator(); i.hasNext();) {
Node node = (Node)i.next();
if (selectingRelationshipField(node, context)) {
selectContext.useOuterJoins();
}
node.applyToQuery(reportQuery, context);
selectContext.dontUseOuterJoins();
}
reportQuery.endAddingToConstructorItem();
}
|
public java.lang.String | getAsString()INTERNAL
Get the string representation of this node.
StringBuffer repr = new StringBuffer();
repr.append("NEW ").append(className);
repr.append("(");
for (Iterator i = constructorItems.iterator(); i.hasNext();) {
Node node = (Node)i.next();
repr.append(node.getAsString());
if (i.hasNext()) {
repr.append(", ");
}
}
repr.append(")");
return repr.toString();
|
private java.lang.Class | getConstructorClass(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)Check the specifid constructor class and return its class instance.
Object type = getType();
if (type == null) {
throw EJBQLException.constructorClassNotFound(
context.getQueryInfo(), getLine(), getColumn(), className);
}
return (Class)type;
|
public java.util.List | getConstructorItems()INTERNAL
Get the list of constructor items of this node.
return this.constructorItems;
|
public boolean | isConstructorNode()INTERNAL
Is this node a ConstructorNode
return true;
|
private boolean | selectingRelationshipField(oracle.toplink.essentials.internal.parsing.Node node, oracle.toplink.essentials.internal.parsing.GenerationContext context)INTERNAL
if ((node == null) || !node.isDotNode()) {
return false;
}
return !((DotNode)node).endsWithDirectToField(context);
|
public void | setConstructorItems(java.util.List items)INTERNAL
Set the list of constructor items of this node.
this.constructorItems = items;
|
public void | validate(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)INTERNAL
Validate node and calculate its type.
for (Iterator i = constructorItems.iterator(); i.hasNext();) {
Node item = (Node)i.next();
item.validate(context);
}
// Resolve constructor class
TypeHelper typeHelper = context.getTypeHelper();
Object type = typeHelper.resolveTypeName(className);
if (type == null) {
String name = className;
// check for inner classes
int index = name.lastIndexOf('.");
if (index != -1) {
name = name.substring(0, index) + '$" + name.substring(index+1);
type = typeHelper.resolveTypeName(name);
}
}
setType(type);
|