- I created a model
RequisitionDetail. - It has some properties, such as:
requisitionId(a foreign key on requisition table),productId(a foreign key on product table),quantity,unitPrice,totalPrice. - When I declare annotation @ManyToOne or @OneToOne and deploy the code, I have this error.
Without declared @ManyToOne or @OneToOne annotation my application is deployed Successfully.
How to solve this problem?
I Attach the Code Bellow : Class Name: RequisitionDetail.java
@Entity
@Table(name = "requisition_details")
public class RequisitionDetail {
@Id
private Long id;
@ManyToOne(cascade = CascadeType.ALL)
@Column(name = "requisition_id")
private Long requisitionId;
@OneToOne
@Column(name = "product_id")
private Long productId;
private int quantity;
@Column(name = "unit_price")
private Double unitPrice;
@Column(name = "total_price")
private Double totalPrice;
}