package example;
import jakarta.persistence.*;
@Entity
@Table(name="order_line")
public class OrderLine {
    @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="line_ids")
    @SequenceGenerator(name="line_ids", sequenceName="line_seq", allocationSize=1)
    private Long id;
    @ManyToOne(fetch=FetchType.LAZY, optional=false)
    @JoinColumn(name="order_id", nullable=false)
    private PurchaseOrder order;
    @Column(nullable=false, length=80) private String sku;
    protected OrderLine() {}
    OrderLine(PurchaseOrder order,String sku) { this.order=order; this.sku=sku; }
    void clearOrder() { order=null; }
    public String getSku() { return sku; }
}
