/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityJB;

import java.io.Serializable;
import javax.persistence.*;


/**
 *
 * @author eve
 */
@Entity
@Table(name="BALES")
@SequenceGenerator(name="SQ_BALES",sequenceName="SQ_BALES", initialValue=1, allocationSize=1)

@NamedQueries({
   

    @NamedQuery(name = "getBaleswithname",query = "SELECT i FROM Baleent i WHERE i.balname= :balname")

    })

public class Baleent implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id

    @GeneratedValue(strategy = GenerationType.AUTO,  generator="SQ_BALES")
    private Long balid;

    
    @Column(name="NAME", nullable=true, length=40)
	private String balname;
	@Column(name="DESCRIPTION", nullable=true, length=200)
	private String description;
	@Column(name="COLOUR", nullable=true, length=20)
	private String colour;
	@Column(name="PRICE", nullable=true, length=20)
	private double price;
	@Column(name="BALSIZE", nullable=true, length=50)
	private String balsize;
      @Column(name="BALEPIC", nullable=true, length=200)
	private String balpic;

   
    public Baleent(){
	}

	public Baleent(Long balid){
            this.balid=balid;
        }

	public Baleent(Long balid, String balname){
            this.balid=balid;
            this.balname =balname;
        }

	public Baleent(Long balid,String balname, String description, String colour, double price, String balsize ){
            this.balid=balid;
            this.balname =balname;
            this.description=description;
            this.colour=colour;
            this.price=price;
            this.balsize=balsize;
                   }


    public Long getBalid() {
        return balid;
    }

    public void setBalid(Long balid) {
        this.balid = balid;
    }
    /**
    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;

    }*/

     public String getBalname(){
		return balname;}

	public void setBalname(String balname){
		this.balname=balname;}

	public String getDescription(){
		return description;}

	public void setDescription(String description){
		this.description=description;}

	public String getColour(){
		return colour;}

	public void setColour(String colour){
		this.colour=colour;}

	public double getPrice(){
		return price;}

	public void setPrice(double price){
		this.price=price;}

	public String getBalsize(){
		return balsize;}

	public void setBalsize(String balsize){
		this.balsize=balsize;}

    public String getBalpic(){
		return balpic;}

	public void setBalpic(String balpic){
		this.balpic=balpic;}

        @Override
    public int hashCode() {
        int hash = 0;
        hash += (balid != null ? balid.hashCode() : 0);
        return hash;
    }

    //@Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Baleent)) {
            return false;
        }
        Baleent other = (Baleent) object;
        if ((this.balid == null && other.balid != null) || (this.balid != null && !this.balid.equals(other.balid))) {
            return false;
        }
        return true;
    }

    //@Override
    public String toString() {
        return "entityJB.Baleent[balid=" + balid + balname + "]";
    }

}
