[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[eclipselink-users] New instances and resolving mappings
|
Hello all,
I am faced with a problem which I am unable to get a grip on. This is the
scenario:
I instantiate a POJO which is annotated as an Entity. In the POJO there are
annotations which are used to reference other tables in the database, like:
@ManyToOne(fetch=FetchType.LAZY,optional=false)
@JoinColumn(name="LEVNR", referencedColumnName = "LEVNR", insertable =
false, updatable = false)
private Leverancier leverancier;
public Leverancier getLeverancier() {
return leverancier;
}
public void setLeverancier(Leverancier leverancier) {
this.leverancier = leverancier;
}
When I now invoke getLeverancier() on the instantiated object, I would
expect a trip to the database to get the information. However, this never
happens, 'leverancier' remains null and the application falls over. The
information to retrieve the required leverancier is set-up correctly
(LEVNR).
Does the newly created entity need be managed in order for mappings to work?
Am I overlooking anything?
Thanks...all help is appreciated
--
View this message in context: http://www.nabble.com/New-instances-and-resolving-mappings-tp24756761p24756761.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.