Thiva Kugan

Greenhorn
+ Follow
since Nov 20, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Thiva Kugan

Thanks for the reply. How about OneToOne mapping in the above case. I mean OneToOne association between Employee to Car.

Regards t
Hi Guys,

I am new to JPA and i have a question about the OneTOMany unidirectional mapping. Let we assume the following example two entities
Person (ID, NAME) and Car (ID, CAR_NAME, PER_ID) i.e the foreign key is in the target table.

Here is my relationship mapping inside the Person entity;

@OneToMany(cascade = CascadeType.ALL)
@JoinTable(name = "CAR",
joinColumns = @JoinColumn(name = "PER_ID"),
inverseJoinColumns = @JoinColumn(name = "ID"))
private List<Car> cars;

Note this is an unidirectional OneToMany mapping from Person to Car. I am using Eclipselink and the above mapping is always not working . Sometimes system throws the exception and says CAR_ID is not found.

If any of you came similar issue please share your idea. Much appreciate your reply.

Regards t
Hi Guys,

We are also getting the same issue. Any hit to resolve this issue?

Thiva
[[email protected]]
17 years ago