persistence@glassfish.java.net

Re: JPQL: create ReadAllQuery for simple SELECT queries

From: Tom Ware <tom.ware_at_oracle.com>
Date: Tue, 28 Nov 2006 09:57:56 -0500

Hi Michael,

  'Just one comment.

  Fetch joins could be an issue since they are supported in
ReadAllQuery, but with different API. See
ObjectLevelReadQuery.addJoinedAttribute(Expression). How difficult
would it be to allow fetch joins to work on ReadAllQueries?

-Tom

Michael Bouschen wrote:

>Hi Tom, hi Jielin,
>
>attached you find my changes to fix issue 1519 "JPQL: create a
>ReadAllQuery for simple queries":
>https://glassfish.dev.java.net/issues/show_bug.cgi?id=1519
>
>This change allows to map a simple SELECT query to a ReadAllQuery
>instance, where other SELECT queries are mapped to a ReportQuery. A
>query falls into the ReadAllQuery category, if
>- the SELECT clause consists of a single expression
>- the SELECT clause expression is an identification variable w/o
>projection (which means the query returns entities)
>- the identification variable is defined as range variable w/o FETCH
>JOINs and is the base of the generated TopLink query instance.
>
>Thanks!
>
>Regards Michael
>
>
>

-- 
Tom Ware
Principal Software Engineer
Oracle Canada Inc.
Direct: (613) 783-4598
Email: tom.ware_at_oracle.com