Skip to main content

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

Hi,

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")

Cheers,
Guy

----- 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 =
FetchType.EAGER)
private Collection bcollection;

And B relates to A like this:

@JoinColumn(name = Bkeyname, referencedColumnName = Akeyname)
@ManyToOne
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
collection,
what am i doing wrong?
Thanks in advance
--
View this message in context: http://www.nabble.com/Newbie-mapping-question-tp19430896p19430896.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users




Back to the top