/*******************************************************************************
 *  Copyright (c) 2015 XLAB d.o.o.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  @author XLAB d.o.o.
 *******************************************************************************/
package eu.cloudscale.showcase.db.model.hibernate;

// Generated May 16, 2013 3:07:18 PM by Hibernate Tools 4.0.0

import eu.cloudscale.showcase.db.model.IItem;
import eu.cloudscale.showcase.db.model.IOrderLine;
import eu.cloudscale.showcase.db.model.IOrders;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * OrderLine generated by hbm2java
 */
@Entity
@Table(name = "order_line", catalog = "tpcw")
//@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
//TODO Jhonny removed cache
public class OrderLine implements IOrderLine {
    private Integer id;

    private IOrders orders;

    private IItem item;

    private Integer olQty;

    private Double olDiscount;

    private String olComment;

    public OrderLine() {
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "OL_ID", unique = true, nullable = false)
    public Integer getOlId() {
        return this.id;
    }

    public void setOlId(Integer olId) {
        this.id = olId;
    }

    @ManyToOne(targetEntity = Orders.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "OL_O_ID", nullable = false)
    public IOrders getOrders() {
        return this.orders;
    }

    public void setOrders(IOrders orders) {
        this.orders = orders;
    }

    @ManyToOne(targetEntity = Item.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "OL_I_ID", nullable = false)
    public IItem getItem() {
        return this.item;
    }

    public void setItem(IItem item) {
        this.item = item;
    }

    @Column(name = "OL_QTY")
    public Integer getOlQty() {
        return this.olQty;
    }

    public void setOlQty(Integer olQty) {
        this.olQty = olQty;
    }

    @Column(name = "OL_DISCOUNT")
    public Double getOlDiscount() {
        return this.olDiscount;
    }

    public void setOlDiscount(Double oL_DISCOUNT) {
        this.olDiscount = oL_DISCOUNT;
    }

    @Column(name = "OL_COMMENT", length = 100)
    public String getOlComment() {
        return this.olComment;
    }

    public void setOlComment(String olComment) {
        this.olComment = olComment;
    }

}
