ObjectDB ObjectDB

Issue #14: JPQL Case Statements (JPA 2.0)

Type: Feature RequestVersion: 1.4.0Priority: NormalStatus: ActiveReplies: 1

JPQL 2.0 adds support of CASE statements for conditional expressions in queries, similarly to switch/case/default in Java, and based on the SQL syntax.

Case statements are currently not supported by ObjectDB.

ObjectDB Support

I wish to express also my interest in CASE statement support, which I need for conditional projection query results as described in  Pro JPA2 p.231 - 233. Could this please be prioritised.

EDIT: expanding. Need for cases like:

SELECT TYPE(e), e.id, e.name, TYPE(e.project), e.project.id, e.project.name, TYPE(e.owner), e.owner.id, e.owner.name FROM Element e

Projection query skips result row when project or owner null. Need CASE statement to check for when project or owner null and offer null projection query values in that case.

Results from the above query are used to construct a minimal Data Transfer Object (DTO) that is just enough to expose a named link (with id parameter) to the full view page of a fully loaded Element entity, and similarly links to the project or owner of an element, and class info. Experience shows this projection query approach is much faster than a query that loads full entities  - when only such links are needed (say in simple lists/tables) - even when most relationship fields of an entity are forced lazy.




To post on this website please sign in.