return 1;
}
private Value getIdentifier(JPQLNode node) {
final String name = node.text;
final Value val = getVariable(name, false);
ClassMetaData cmd = getMetaDataForAlias(name);
if (cmd != null) {
// handle the case where the class name is the alias
// for the candidate (we don't use variables for this)
Value thiz = null;
if (ctx().subquery == null ||
ctx().getSchema(name.toLowerCase()) == null) {
if (ctx().subquery != null && inAssignSubselectProjection)
thiz = factory.newPath(ctx().subquery);
else
thiz = factory.getThis();
} else {
thiz = factory.newPath(ctx().subquery);
}
((Path)thiz).setSchemaAlias(name);
thiz.setMetaData(cmd);
return thiz;
} else if (val instanceof Path) {
return (Path) val;
} else if (val instanceof Value) {
if (val.isVariable()) {
// can be an entity type literal
Class<?> c = resolver.classForName(name, null);
if (c != null) {
Value lit = factory.newTypeLiteral(c, Literal.TYPE_CLASS);
Class<?> candidate = getCandidateType();
ClassMetaData can = getClassMetaData(candidate.getName(),
false);
ClassMetaData meta = getClassMetaData(name, false);
if (candidate.isAssignableFrom(c))
lit.setMetaData(meta);
else
lit.setMetaData(can);
return lit;
}
}
return (Value) val;
}