Hi Sebastian,

there is no @Where annotation. You have to use a custom JPQL query like
this:

@Entity
@Table(name = "naviglobal")
*@NamedQuery(name="getDeleted" query = "SELECT ng FROM Naviglobal ng LEFT
JOIN ng.mainnavi mn WHERE mn.deleted = true")
*public class *Naviglobal* implements Serializable {
...
    @OneToMany(*fetch = FetchType.LAZY*)
    @JoinColumn(name="global_id")
    private List<Navimain> mainnavi;* 
...

Somewhere in your service / DAO / or whatever:

TypedQuery<Naviglobal> q = em.createNamedQuery("getDeleted",
Naviglobal.class);
List<Naviglobal> result = q.getResultList();

HTH,
Tobias

--
View this message in context: 
http://openjpa.208410.n2.nabble.com/Defining-Where-clause-on-OneToMany-Association-Why-is-there-no-Where-Annotation-tp6994016p7062094.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to