Bug 385350 - JPQL TREAT followed by JOIN problem.
Summary: JPQL TREAT followed by JOIN problem.
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 374771
Blocks:
  Show dependency tree
 
Reported: 2012-07-17 16:56 EDT by Anthony Hinsinger CLA
Modified: 2022-06-09 10:25 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Hinsinger CLA 2012-07-17 16:56:06 EDT
Hello

I'm trying to use the TREAT JPQL feature in this query :

SELECT DISTINCT a FROM Shop s JOIN TREAT(shop.products AS Book) b JOIN b.author a WHERE s = :shop

The goal is to get all distinct book authors sold in a given shop. This query should return a List of "distinct" Author, but I get a List of Long with only IDs of books.

Is it a bug, or a known limitation of TREAT ?

Thanks.
Comment 1 Anthony Hinsinger CLA 2012-07-17 17:09:39 EDT
I've forgotten to add that the generated SQL statement looks good, SELECT contains all Author column.
Comment 2 Anthony Hinsinger CLA 2012-07-18 06:33:05 EDT
errata: the List contains IDs of Author, not books. Sorry
Comment 3 Tom Ware CLA 2012-08-30 10:09:48 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 4 Chris Delahunt CLA 2012-11-02 17:09:51 EDT
Treat support is being worked on in bug 374771 for JPA 2.1 and still has issues in what is currently available.   I've made this bug dependent on 374771 so that this use case is included when support is finalized.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:25:08 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink