persistence@glassfish.java.net

EJBQL: question about state fields of an embedded class type

From: Michael Bouschen <Michael.Bouschen_at_Sun.COM>
Date: Tue, 03 Jan 2006 15:01:45 +0100

Hi Linda, hi Mike,

Happy New Year!

I have a question about embedded objects in EJBQL: does EJBQL allow
comparing of embedded objects? Suppose class Customer has a property
embeddedCountry annotated as @Embedded of @Embeddable type
EmbeddedCountry. The following EJBQL query compare the property with a
parameter:
   SELECT c FROM Customer c WHERE c.embeddedCountry = :param

I read chapter 4.4.4 Path Expressions that I can navigate through an
embedded object. But a path expression must end in a simple state-field
which cannot refer an embedded object. Is this correct? Then the above
query would not be valid.

Regards Michael