For a one to many relationship for all the lines of the order, you can have this in line class : @OneToMany @JoinColumn(name = "line_id") @org.hibernate.annotations.Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN) public Set<Line> getLines() { return lines; }
public void setLines(final Set<Line> lines) { this.lines = lines; }
And in the line class for a many to one relation to single order : @ManyToOne(targetEntity = Order.class) @JoinColumn(name = "order_id", referencedColumnName = "order_id", unique = false, insertable = true, updatable = true, nullable=false) public Order getOrder() { return order; }
public void setPricingGroup(FlsUnitWeekPricingGroup pricingGroup) { this.pricingGroup = pricingGroup; }
_________________ Thanks, Ajit Singh ajits@mindfiresolutions.com www.mindfiresolutions.com
|