Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database column's name contains $ sign #68

Open
vitalz opened this issue Oct 14, 2015 · 1 comment
Open

database column's name contains $ sign #68

vitalz opened this issue Oct 14, 2015 · 1 comment

Comments

@vitalz
Copy link

vitalz commented Oct 14, 2015

Consider if $ is not forbidden in database column naming then people may use it. If database column's name contains $ sign then org.apache.cayenne.exp.parser.ParseException with be thrown. For instance,

.matchBy("db:team$")

Cayenne expression parser thinks that $ means to bind parameter there, etc. That is why if fails.

Caused by: org.apache.cayenne.exp.ExpressionException: [v.4.0.M3.debfa94 May 22 2015 16:06:39] Encountered " "$" "$ "" at line 1, column 8.
Was expecting one of:
    <EOF> 
    "or" ...
    "and" ...
    "not" ...
    "!" ...
    "=" ...
    "==" ...
    "!=" ...
    "<>" ...
    "<=" ...
    "<" ...
    ">" ...
    ">=" ...
    "like" ...
    "likeIgnoreCase" ...
    "in" ...
    "between" ...
    "|" ...
    "^" ...
    "&" ...
    "<<" ...
    ">>" ...
    "+" ...
    "-" ...
    "*" ...
    "/" ...

    at org.apache.cayenne.exp.ExpressionFactory.fromString(ExpressionFactory.java:1035)
    at org.apache.cayenne.exp.ExpressionFactory.exp(ExpressionFactory.java:996)
    at com.nhl.link.move.runtime.task.MapperBuilder.createSafeKeyMapper(MapperBuilder.java:105)
    at com.nhl.link.move.runtime.task.MapperBuilder.build(MapperBuilder.java:90)
    at com.nhl.link.move.runtime.task.createorupdate.DefaultCreateOrUpdateBuilder.createProcessor(DefaultCreateOrUpdateBuilder.java:239)
    at com.nhl.link.move.runtime.task.createorupdate.DefaultCreateOrUpdateBuilder.task(DefaultCreateOrUpdateBuilder.java:233)
    at com.nhl.link.*************
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.apache.tapestry5.ioc.internal.util.ConstructorInvoker.invoke(ConstructorInvoker.java:48)
    ... 25 more
Caused by: org.apache.cayenne.exp.parser.ParseException: Encountered " "$" "$ "" at line 1, column 8.
Was expecting one of:
    <EOF> 
    "or" ...
    "and" ...
    "not" ...
    "!" ...
    "=" ...
    "==" ...
    "!=" ...
    "<>" ...
    "<=" ...
    "<" ...
    ">" ...
    ">=" ...
    "like" ...
    "likeIgnoreCase" ...
    "in" ...
    "between" ...
    "|" ...
    "^" ...
    "&" ...
    "<<" ...
    ">>" ...
    "+" ...
    "-" ...
    "*" ...
    "/" ...

    at org.apache.cayenne.exp.parser.ExpressionParser.generateParseException(ExpressionParser.java:1722)
    at org.apache.cayenne.exp.parser.ExpressionParser.jj_consume_token(ExpressionParser.java:1657)
    at org.apache.cayenne.exp.parser.ExpressionParser.expression(ExpressionParser.java:47)
    at org.apache.cayenne.exp.ExpressionFactory.fromString(ExpressionFactory.java:1030)
    ... 36 more
@andrus
Copy link
Contributor

andrus commented Oct 14, 2015

I opened a Jira in Cayenne: https://issues.apache.org/jira/browse/CAY-2034 This is a limitation of Cayenne expression parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants