Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-809

Support for explicit mapping of SQL results with SQLResultSetMapping

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0M4, 3.0
    • Core Library
    • 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.

      Attachments

        Activity

          People

            andrus Andrus Adamchik
            andrus Andrus Adamchik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: