The JPA Processor fills the gap between Olingo V4 and the database, by providing a mapping between JPA metadata and OData metadata, generating queries and supporting the entity manipulations.
OData count from a composite key,
http://[localhost:9010/Trippin/v1/Trips?$count=true
translate to query again db
SELECT COUNT(DISTINCT(E0."ID", E0."Entity")) S0 FROM "Trippin"."Trip" E0
works fine with hsqldb.
but for Oracle database, it throw ORA-00907: missing right parenthesis error.
how to customize the query to one that can run in Oracle database, like
SELECT E0."ID" || E0."ENTITY" || E0."DATA" FROM "PENFAX"."TRIP" E0
OR
SELECT COUNT (*) FROM (
SELECT DISTINCT E0."ID" S0, E0."ENTITY" S1, E0."DATA" S2 FROM "PENFAX"."TRIP" E0)
As you have noticed, the JPA Processor not all databases support COUNT(DISTINCT(E0."ID", E0."Entity")). It will be investigated what the best way to replace this construct.
OData count from a composite key, http://[localhost:9010/Trippin/v1/Trips?$count=true translate to query again db SELECT COUNT(DISTINCT(E0."ID", E0."Entity")) S0 FROM "Trippin"."Trip" E0 works fine with hsqldb.
but for Oracle database, it throw ORA-00907: missing right parenthesis error.
how to customize the query to one that can run in Oracle database, like SELECT E0."ID" || E0."ENTITY" || E0."DATA" FROM "PENFAX"."TRIP" E0
OR
SELECT COUNT (*) FROM ( SELECT DISTINCT E0."ID" S0, E0."ENTITY" S1, E0."DATA" S2 FROM "PENFAX"."TRIP" E0)