toplink « Annotation « JPA Q&A

1. The @JoinColumns on the annotated element [...] from the entity class [...] is incomplete

I make use of: NetBeans IDE 6.7.1, GlassFish v2.1, Oracle 10g XE, JAVA 6 SE, JAVA 5 EE. I have problem with an @ManyToMany annotation:

@JoinTable(name="CUST_RENT_MOVIE", joinColumns={@JoinColumn(name="CUST_ID")}, inverseJoinColumns={@JoinColumn(name="TITLE")})
private Collection<CustRentMovie> rents = new ...

2. Why cannot join 3rd table using JPA TopLink annotation?

I have simple 3 tables:


-user_id  //FK

-address_id //FK
  • Users can have many Addresses
  • Addresses can have many Phone
Thus, annotations applied to each entity class would look like: Users
    @OneToMany(cascade = CascadeType.ALL, ...