I have a bidirectional one-to-many relationship with the following entity classes:
0 or 1 client <-> 0 or more product orders
When persis
Use @Joincolumn annotation in your ProductOrder entity, please see below.
@Entity
public class ProductOrder implements Serializable, ChildEntity {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@ManyToOne // owning side
@JoinColumn(name = "PRODUCTORDER_ID", referencedColumnName = "ID")
//write your database column names into name and referencedColumnName attributes.
private Client client;
// other fields, getters and setters
}