mirror of https://github.com/apache/openjpa.git
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:
parent
b56f30427f
commit
75309a2447
|
@ -1322,8 +1322,11 @@ public class JPQLExpressionBuilder
|
||||||
Object value = field.get(null);
|
Object value = field.get(null);
|
||||||
return factory.newLiteral(value, Literal.TYPE_UNKNOWN);
|
return factory.newLiteral(value, Literal.TYPE_UNKNOWN);
|
||||||
} catch (NoSuchFieldException nsfe) {
|
} catch (NoSuchFieldException nsfe) {
|
||||||
|
if (node.inEnumPath)
|
||||||
throw parseException(EX_USER, "no-field",
|
throw parseException(EX_USER, "no-field",
|
||||||
new Object[]{ c.getName(), fieldName }, nsfe);
|
new Object[]{ c.getName(), fieldName }, nsfe);
|
||||||
|
else
|
||||||
|
return getPath(node, false, true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw parseException(EX_USER, "unaccessible-field",
|
throw parseException(EX_USER, "unaccessible-field",
|
||||||
new Object[]{ className, fieldName }, e);
|
new Object[]{ className, fieldName }, e);
|
||||||
|
@ -1556,10 +1559,12 @@ public class JPQLExpressionBuilder
|
||||||
JPQLNode[] children;
|
JPQLNode[] children;
|
||||||
String text;
|
String text;
|
||||||
boolean not = false;
|
boolean not = false;
|
||||||
|
boolean inEnumPath = false;
|
||||||
|
|
||||||
public JPQLNode(JPQL parser, int id) {
|
public JPQLNode(JPQL parser, int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.parser = parser;
|
this.parser = parser;
|
||||||
|
this.inEnumPath = parser.inEnumPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void jjtOpen() {
|
public void jjtOpen() {
|
||||||
|
|
|
@ -64,6 +64,7 @@ import java.io.*;
|
||||||
public class JPQL
|
public class JPQL
|
||||||
{
|
{
|
||||||
String jpql;
|
String jpql;
|
||||||
|
boolean inEnumPath;
|
||||||
|
|
||||||
|
|
||||||
public JPQL (String jpql)
|
public JPQL (String jpql)
|
||||||
|
@ -968,7 +969,9 @@ void enum_primary() : { }
|
||||||
|
|
||||||
void enum_literal() : { }
|
void enum_literal() : { }
|
||||||
{
|
{
|
||||||
|
{ inEnumPath = true; }
|
||||||
path()
|
path()
|
||||||
|
{ inEnumPath = false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue