Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0
-
None
Description
In Cayenne query results are either Persistent objects or DataRows (maps). In JPA query results are lists of Object or Object[], with Objects that can be scalar values (e.g. Long for COUNT query) or persistent objects. We need a similar functionality in Cayenne.
JPA has a concept of SqlResultSetMapping that provides a specification for decoding a result row. Support SqlResultSetMapping objects for postconversion of DataRows.
1. Support for SQLResultSetMapping in QueryMetadata
2. Support for SQLResultSetMapping in ObjectContextQueryAction and DataDomainQueryAction (would take precedence over "dataRows" flag and would result in suppressing any prefetch settings).
3. Support for SQLResultSetMapping in SQLTemplate (the only query that would support it directly)
4. Support for setting SQLResultSetMapping in EJBQLAction based on parsed EJBQL.
5. Update the docs for ObjectContext.performQuery to reflect the new results
Initial limitations:
- No support for EntityResultMapping
- No support for multiple SQLResultSetMapping's per query
- No support for SQLResultSetMapping in ProcedureQuery.