on 10-18-2020 2:52 PM
Hi,
We are using CAP Java and HANA Cloud. We can succesfully execute simple SQL statements by using the Query Builder API but we have some problems with more complex queries, for example:
Select.from(Apicalls_.class)
.distinct()
.columns(c -> func("TO_DATE", c.Date()).as("date"),
c -> func("COUNT", c.UserId()).as("count"))
.groupBy(g -> func("TO_DATE", g.Date()))
.orderBy(o -> func("TO_DATE", o.Date()).asc())
I find many examples for Node.js but the examples for CAP Java are always very simple SQL statements....
Can anybody help with some examples?
Best Regards,
Chris
Hi all,
I have the following problem. My SQL like this:
SELECT TO_DECIMAL(SCORE(),3,2) score, T0.title as "title"<br>FROM MY_BOOKSHOP_BOOKS T0 WHERE CONTAINS(T0.title, 'olbia city', FUZZY(0.7,'similarCalculationMode=substringsearch'))<br>order by SCORE() DESC;
How can I build it with CQL statements in Java? I don't know how to execute a query with "order by SCORE() DESC".
Select.from(Books_.class) .where(e -> booleanFunc("CONTAINS", Arrays.asList(CQL.get(Books.TITLE).asRef(), val("olbia city"), plain("FUZZY(0.7, 'similarCalculationMode=substringsearch')"))))
Best regards,
Lihua
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.