package ecat.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="cart")
public class Cart {
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	Long NoNota;
	
	@OneToOne(optional=false, fetch=FetchType.LAZY, cascade=CascadeType.ALL)
	@JoinColumn(name="catid", insertable= true, updatable=true, referencedColumnName="catid")
	Long CatId; 

	@OneToOne(optional=false, fetch=FetchType.LAZY, cascade=CascadeType.ALL)
	@JoinColumn(name="username", insertable= true, updatable=true, referencedColumnName="username")
	String UserName;

	@Column(name="item")
	String ItemName;
	
	@OneToOne(optional=false, fetch=FetchType.LAZY, cascade=CascadeType.ALL)
	@JoinColumn(name="catprice", insertable= true, updatable=true, referencedColumnName="catprice")
	Integer Price;
	
	@Column(name="quantity")
	Integer Quantity;
	
	@Column(name="diskon")
	Integer Diskon;
	
	@Column(name="totalprice")
	Integer TotalPrice;
	
	@Column(name="cartstatus")
	Boolean CartStatus;

	
	public Long getNoNota() {
		return NoNota;
	}

	public void setNoNota(Long noNota) {
		NoNota = noNota;
	}

	public Long getCatId() {
		return CatId;
	}

	public void setCatId(Long catId) {
		CatId = catId;
	}

	public String getUserName() {
		return UserName;
	}

	public void setUserName(String userName) {
		UserName = userName;
	}

	public String getItemName() {
		return ItemName;
	}

	public void setItemName(String itemName) {
		ItemName = itemName;
	}

	public Integer getPrice() {
		return Price;
	}

	public void setPrice(Integer price) {
		Price = price;
	}

	public Integer getQuantity() {
		return Quantity;
	}

	public void setQuantity(Integer quantity) {
		Quantity = quantity;
	}

	public Integer getDiskon() {
		return Diskon;
	}

	public void setDiskon(Integer diskon) {
		Diskon = diskon;
	}

	public Integer getTotalPrice() {
		return TotalPrice;
	}

	public void setTotalPrice(Integer totalPrice) {
		TotalPrice = totalPrice;
	}

	public Boolean getCartStatus() {
		return CartStatus;
	}

	public void setCartStatus(Boolean cartStatus) {
		CartStatus = cartStatus;
	}
	
	
}
