-------- Original Message -------- Subject: Re: [Hibernate] HQL 3.1 Date: Tue, 29 Mar 2005 14:29:00 +0200 From: Mario Ivankovits <[EMAIL PROTECTED]> To: Emmanuel Bernard <[EMAIL PROTECTED]> References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
Emmanuel Bernard wrote:
- instanceof is cool, but casting is more useful
where ( p instanceof Cheque and ((Cheque) p).paperType = :paperType) or (p instanceof CreditCard and ((CreditCard) p).pinCode)
In this case I would prefer not to have to cast at all, thus
where ( p instanceof Cheque and p.paperType = :paperType) or (p instanceof CreditCard and p.pinCode)
should be enough.
And if one write
where p.paperType = :paperType
and p isnt of type Cheque (or to be more concrete, do not have a property named paperType) simply throw a PropertyNotFound exception.
--- Mario
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel