Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Expression, joins and inheritance

Thanks for the hint. It also crossed my mind, but since I do not know how
much subclasses there will be at compile time of the base-class B, I cannot
use this strategy. I.e. I cannot add OneToOne to the base-class for every
subclass. Suppose I have 20, then I have a lot of properties to add :-(.

Greetings
Jan


James Sutherland wrote:
> 
> EclipseLink does not currently have support for casting in an Expression
> or JPQL, so please log an enhancement request for this.  However it is
> possible to do this using a QueryKey.
> 
> In your ClassDescriptor for A define a OneToOneQueryKey "myC" that
> reference the C class, and uses the same foreign key join as to B.  You
> can also define one to D.  Then in your query when you want to query on C
> access the new query key "myC" instead of "myB".
> 
> i.e.
> expressionBuilder.get("myC").get("cProperty")
> 
> You can also do this using a parallel expression, but it will cause an
> extra join.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Expression%2C-joins-and-inheritance-tp22804915p22804978.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top