Community
Participate
Working Groups
Add query hints for all missing functionality of the query framework: - maintain-cache - session-name - prepare - jdbc.cache-statement - sql.hint - flush - jdbc.native-connection - sql - call - redirect - expression - query-type +support all query types - result-type (Map, Array, Value, Values) - cursor - cursor.initial-size - cursor.page-size - cursor.scrollable - cursor.scrollable.result-set-type (Forward, ForwardOnly, Unknown, Reverse, ScrollInsensitive, ScrollSensitive) - cursor.scrollable.result-set-concurrency (ReadOnly, Updatable) - cursor.size-query - fetch-group.name - fetch-group.attribute - fetch-group.default - cache-usage.indirection-policy (Include, Exclude, ThrowException, Trigger) - cache-usage +support modify queries - exclusive-connection - inheritance.outer-join - history.as-of - history.as-of-scn - example-object - example-object.policy - hierarchical.connect-by - hierarchical.start-with - hierarchical.order-siblings - jdbc.first-result The hierarchical probably needs to be added to JPQL instead of hints.
Also need to fix the multi hints (batch, fetch) currently storing hints in a Map prevents these from working. Also for fetch hint need outer join option.
Setting to Future due to large set of query hints. If a subset are more important, we can move them to a new bug with a nearer Target Milestone
Also, - redirect alredy exists as query.redirector, but needs to be extended to take a class name, currently only takes an instance, which does not work from meta-data - native queries are always created as DataRead, and not all properties copied over if switched to DataModify, need to use copyFromQuery(), current code will also fail for existing NamedStoredProcedureQuery. - native queries currently return Vector of values, but spec requires array - getSingleResult should allow returning of Cursors and Maps, (and Sets?) - need to add getCursorResult() Decided not to add sql, native queries can do everything for this. Decided not to add call, expression, example, as should be EntityManager API and could not use from meta-data. Decided not to add connectby as should be part of JPQL and could not use from meta-data. Decided not to add session-name, as only for SessionBroker, should be added when SessionBroker support is added.
Also result-collection-class does not use correct class loader, and does not set the collection into DataReadQuery types.
Created attachment 118147 [details] Adds missing query hints
This patch adds the following hints, - maintain-cache - prepare - jdbc.cache-statement - sql.hint - flush - jdbc.native-connection - cursor - cursor.initial-size - cursor.page-size - cursor.scrollable - cursor.size-sql - fetch-group.name - fetch-group.attribute - fetch-group.default - cache-usage +support modify queries - exclusive-connection - inheritance.outer-join - history.as-of - history.as-of-scn - jdbc.first-result Also fixed, - native queries are always created as DataRead, and not all properties copied over if switched to DataModify, need to use copyFromQuery(), current code will also fail for existing NamedStoredProcedureQuery. - getSingleResult should allow returning of Cursors and Maps, (and Sets) - need to add getResultCursor() And improved all hint comments.
This patch adds the following query hints: - query-type +support all query types - result-type (Map, Array, Value, Values) - cursor.scrollable.result-set-type (Forward, ForwardOnly, Unknown, Reverse, ScrollInsensitive, ScrollSensitive) - cursor.scrollable.result-set-concurrency (ReadOnly, Updatable) - fetch-group - cache-usage.indirection-policy (Include, Exclude, ThrowException, Trigger) - left-fetch Other changes include: - Query redirector hint take class name or class as well as instance - Fixed convertClassNameToClasses for container policy, allows user collections - Added ResultType support to DataReadQuery - Simplified Direct/ValueReadQuery - Fixed setting of fetch group to unprepare query - Better defined ResultType for ReportQuery - Added tests for query hints - Added tests for modify named stored procedures, SQLResultSetMapping, cursors, and join fetching. - Changed Department to use lazy fetching on 1-m's - Changed Customer to use custom collection type - Fixed query hints to allow Map with array values - Fixed native query result type - Added class loader to query creation and hints so correct loader is used - Added query creation API to JpaEntityManager, change existing API to use List - Some cleanup
Created attachment 118839 [details] Adds 2nd set of query hints and fixes
Closing
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink