Is it possible to create a polymorphic query where you are selecting a base class but specifying criteria on one or more derived classes?
For example, I have a base class Profile which has derived classes FtpProfile and SmtpProfile which provide additional properties. What I want to do is be able to cast the base class referred to in the FROM clause to one of the subclasses in the WHERE clause.
eg: (pseudo hql/wish)
Code:
SELECT p FROM Profile p WHERE ((FtpProfile)p.)RootFolder = '\admin' OR ((SmtpProfile)p).Address = 'admin@somewhere.com'
Is there any way to do something like this?
Cheers,
Symon.