I got 2 Entities
Customer.class
@Entity
@Table(name = "Customer")
public class Customer {
@Id
private int id;
@OneToMany(mappedBy = "customer"; fetch = FetchType.EAGER)
private Set<Invoice> invoice;
}
and
Invoice.class
@Entity
@Table(name = "Invoice")
public class Invoice {
@Id
@ManyToOne
@JoinColumn(name = "customer")
private Customer customer;
@Column(name = "price", nullable = false)
private double price;
}
They are both mapped in the persistence.xml.
So:
System.out.println(customer);
for a specific customer gives me 30 Invoice entrys, but I got 33 in the Database.
I use org.eclipse.persistence.jpa 2.5.0 and persistence-api 1.0.2
I appreciate every hint/solution.
Thanks in advance.