MappedSelect/SQLTemplate #chain and #chunk directives

John Huss <[email protected]>
Newsgroups gmane.comp.java.cayenne.user
Message-ID <CAOUwSGt+uXYaiPRVrwEj6E3cXFe4fOjZKY9TM6oSVTTJBhx7FQ@mail.gmail.com>
Looking at the docs
<https://cayenne.apache.org/docs/4.0/cayenne-guide/#queries> for
MappedSelect/SQLTemplate I'm not clear on how to supply the parameters for
the #chain and #chunk directives from the java side. How should I structure
this data and pass it to the SQLTemplate query?

SQL:
#chain('OR' 'AND')
    #chunk($thing1) thing1  = #bind($thing1, 'INTEGER') #end
    #chunk($thing2) thing2 >= #bind($thing2, 'TIMESTAMP') #end
#end"

Java:

Map<String, Object> queryParameters = *new* HashMap<>(2);

queryParameters.put(*?*);


MappedSelect<MyEntity> query = MappedSelect.*query*(MyDataMap.
*MYQUERY_QUERYNAME*, MyEntity.*class*).params(queryParameters);



Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.