OPENJPA-595. Porting to 1.1.x branch.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/1.1.x@655657 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Patrick Linskey 2008-05-12 21:42:57 +00:00
parent b56f30427f
commit 75309a2447
2 changed files with 10 additions and 2 deletions

View File

@ -1322,8 +1322,11 @@ public class JPQLExpressionBuilder
Object value = field.get(null);
return factory.newLiteral(value, Literal.TYPE_UNKNOWN);
} catch (NoSuchFieldException nsfe) {
throw parseException(EX_USER, "no-field",
new Object[]{ c.getName(), fieldName }, nsfe);
if (node.inEnumPath)
throw parseException(EX_USER, "no-field",
new Object[]{ c.getName(), fieldName }, nsfe);
else
return getPath(node, false, true);
} catch (Exception e) {
throw parseException(EX_USER, "unaccessible-field",
new Object[]{ className, fieldName }, e);
@ -1556,10 +1559,12 @@ public class JPQLExpressionBuilder
JPQLNode[] children;
String text;
boolean not = false;
boolean inEnumPath = false;
public JPQLNode(JPQL parser, int id) {
this.id = id;
this.parser = parser;
this.inEnumPath = parser.inEnumPath;
}
public void jjtOpen() {

View File

@ -64,6 +64,7 @@ import java.io.*;
public class JPQL
{
String jpql;
boolean inEnumPath;
public JPQL (String jpql)
@ -968,7 +969,9 @@ void enum_primary() : { }
void enum_literal() : { }
{
{ inEnumPath = true; }
path()
{ inEnumPath = false; }
}