I have a ‘method’ attribute in my Projects entity which came from Method entity. And when the user opens Projects browser screen I want it to automatic filter for “the xy method”.
I have read Query Filter documentation, so I should insert something like that into my screen descriptor:
<query>
<![CDATA[select e from myproject$Projects e]]>
<filter> <and> <c>e.method.id = :param$projectsMethod</c> </and>
</filter>
</query>
But I d not know where to give :param$projectsMethod’s value. I tried e.method. = “the xy method%”, but do not works.
<query>
<![CDATA[select e from myproject$Projects e]]>
<filter>
<and>
<c>e.method.name like "the xy method%"</c>
</and>
</filter>
</query>
And unfortunately when I want to open this screen I get:
“Internal error
Please notify the administrator.
Pay attention to any unsaved data, and click here to continue.”
Do I need to do something else? Insert some code to somewhere else?
2017-05-24 15:35:51.980 ERROR [http-nio-8080-exec-15/myproject/admin] com.haulmont.cuba.web.log.AppLog - Exception in com.haulmont.cuba.web.toolkit.ui.CubaMenuBar:
com.haulmont.cuba.core.sys.jpql.antlr2.JPA2RecognitionException: line 1:37 no viable alternative at character '"'
at com.haulmont.cuba.core.sys.jpql.antlr2.JPA2Lexer.emitErrorMessage(JPA2Lexer.java:4604)
[...]
select e from myproject$Projects e where e.method.method like "%the xy method%"
But I got the same error, in log:
2017-05-25 11:01:34.270 ERROR [http-nio-8080-exec-2/myproject/admin] com.haulmont.cuba.web.log.AppLog - Exception in com.haulmont.cuba.web.toolkit.ui.CubaMenuBar:
com.haulmont.cuba.core.sys.jpql.JpqlSyntaxException: Errors found for input jpql:[select e from myproject$Projects e where e.method.method like "%the xy method%"]
line 1:84 no viable alternative at character '"'
at com.haulmont.cuba.core.global.QueryParserAstBased.getQueryAnalyzer(QueryParserAstBased.java:82)