users@glassfish.java.net

Re: EJBQL Exception

From: <glassfish_at_javadesktop.org>
Date: Mon, 30 Apr 2007 20:47:16 PDT

(Replied on the mailing list and assumed it was bi-directional, doesn't seem so).

You'll need to add @Column attributes for the standard (non-relation) columns, and if you want JPA to do the actual leg-work for you, define a ManyToOne or OneToMany to define the relationships e.g.

  @Entity public class Seller ... {
    ...
    @ManyToOne
    @JoinColumn(name="selcatID")
    private SelCat category;
    ...
  }

Then a query like:

  select slr
  from Seller slr
  where slr.category = :category
    and slr.disabled = false
    and slr.category.someProperty = :someRestriction ...
[Message sent by forum member 'jshevland' (jshevland)]

http://forums.java.net/jive/thread.jspa?messageID=214999