Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Newbie mapping question


Your mapped by is incorrect and should be specified as follows: mappedBy="relateda"

And your JoinColumn is inversed. It should be

@JoinColumn(name="Akeyname", referencedColumnName="Bkeyname")


----- Original Message ----- From: "SerFingolfin" <paolo.trisio@xxxxxxxxx>
To: <eclipselink-users@xxxxxxxxxxx>
Sent: Thursday, September 11, 2008 6:26 AM
Subject: [eclipselink-users] Newbie mapping question

Hi to everybody.
My project works on two entities with a "one to many" relation.
A entity defines a collection of B elements as described here :

@OneToMany(cascade = CascadeType.ALL, mappedBy = Bkeyname, fetch =
private Collection bcollection;

And B relates to A like this:

@JoinColumn(name = Bkeyname, referencedColumnName = Akeyname)
private A relateda;

Fetch = FetchType.EAGER should grant me that every "find" operation
on A should retrieve every B entity related to A, am i wrong?
This is not happening in my project! I always see null values on B
what am i doing wrong?
Thanks in advance
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

eclipselink-users mailing list

Back to the top