| Summary: | QueryHints.BATCH does not work with navigations | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Frank Schwarz <fs5> | ||||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||||
| Status: | NEW --- | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P2 | CC: | cubukcuoglu.baris, jamesssss, tom.ware | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 181119 [details]
stacktrace
Created attachment 181120 [details]
reproducer
Please have a look at methods "queryBatchFetch" or "queryBatchFetchExists" or "queryBatchFetchIn". All of them will fail with the stated exception.
Setting target and priority. See the following page for details about these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines This bug still exists in the version 2.5.1.
It works only, if I transform the nested query to an @NamedQuery, like:
@NamedQuery(name = "CustomerOrder.Test", query = "SELECT o FROM CustomerOrder o", hints = {@QueryHint(name = QueryHints.BATCH, value = "o.orderProducts.product"),
@QueryHint(name = QueryHints.BATCH_TYPE, value = "IN") }) })
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
Build Identifier: Trunk Object model is: Abteilung (department) ->* Mitarbeiter (employee) -> * Projekt (projekt) ->* Standort (location) TypedQuery<Abteilung> query = em.createQuery("SELECT a FROM Abteilung a", Abteilung.class); query.setHint(QueryHints.BATCH, "a.mitarbeiter.projekte"); will result in Exception Description: The expression has not been initialized correctly. Only a single ExpressionBuilder should be used for a query. For parallel expressions, the query class must be provided to the ExpressionBuilder constructor, and the query's ExpressionBuilder must always be on the left side of the expression. Expression: [ Base jpatage.fetchplans.model.Abteilung] Query: ReadAllQuery(referenceClass=Abteilung sql="SELECT ID, NAME FROM ABTEILUNG") This query will work though with above query hint: "SELECT distinct a FROM Abteilung a join a.mitarbeiter m join m.projekte p where p.name is not null Reproducible: Always