Actually, "narrow" is better than "cast":

FROM Order AS order
JOIN order.items NARROW FactoryItem AS item


Gavin King wrote:


William Drai has submitted a very clever little patch
to add class casts to HQL.

I must be stupid, 'cos it never occurred to me that
casts shoudl really be expressed in the FROM clause,
and that makes them /much/ easier to implement. Usually
people have proposed it as something to go in the
WHERE clause, which is harder to implement and
perhaps less elegant.

So, William's patch does it like:

FROM Order AS order
JOIN (FactoryItem) order.items AS item

I think it would be better as this:

FROM Order AS order
JOIN order.items CAST FactoryItem AS item

Which is better? Any other suggestions?



--
Gavin King
JBoss Group
+61 410534454
http://hibernate.org



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to