package com.softgraf.vendas.model.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

@Entity
public class Produto {

	private Integer id;
	private String nome;
	private Float preco;

	public Produto() {
		
	}
	
	public Produto(String nome, Float preco){
		this(null, nome, preco);
	}
	
	public Produto(Integer id, String nome, Float preco){
		this.id = id;
		this.nome = nome;
		this.preco = preco;
	}
	
	@Id
	@GeneratedValue
	public Integer getId() {
		return id;
	}

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

	@Column(length=45, nullable=false, unique=true)
	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	@Column(precision=2, nullable=false)
	public Float getPreco() {
		return preco;
	}

	public void setPreco(Float preco) {
		this.preco = preco;
	}
}
