-
1. Re: Wiring components together in an EntityQuery class
nickarls Oct 19, 2009 11:22 AM (in response to yannfromparis)Why don't you map the entire hierarchy? Put @OneToMany etc on Wine and Appellation in Bottle and just do
select b from Bottle b
. Or am I missing something here? -
2. Re: Wiring components together in an EntityQuery class
yannfromparis Oct 19, 2009 11:32 AM (in response to yannfromparis)Sorry, my mistake. I've in fact defined these relations on the getters in Bottle entity:
@NotNull @OneToOne @JoinColumn(name = "appellation_id") public Appellation getAppellation() { return appellation; } @NotNull @OneToOne @JoinColumn(name = "wine_id") public Wine getWine() { return wine; }
But I've already made a test whith the request you mentioned and it doesn't work, I've got exceptions about null dependencies.
-
3. Re: Wiring components together in an EntityQuery class
nickarls Oct 19, 2009 11:53 AM (in response to yannfromparis)Test it with Java SE, bootstrap a small JPA-block in main(String[]) and try do the stuff with just an entityManager, if it doesn't work, it's not a Seam bug ;-)
(you might also want to check that you also have @Id on the getter, I have seen strange results sometimes when mixing field/getter annotations)
And post full stack traces if you get it to work in hibernate but not in entityquery...