Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package jb.model.bean;
- import mage.utils.SQLClock;
- import java.util.List;
- import java.util.Date;
- import java.io.Serializable;
- import java.util.ArrayList;
- import javax.persistence.Id;
- import javax.persistence.Table;
- import javax.persistence.Column;
- import javax.persistence.Entity;
- import javax.persistence.Temporal;
- import javax.persistence.OneToMany;
- import javax.persistence.FetchType;
- import javax.persistence.ManyToOne;
- import javax.persistence.JoinColumn;
- import javax.persistence.TemporalType;
- import javax.persistence.GeneratedValue;
- import javax.persistence.GenerationType;
- import org.hibernate.annotations.Cascade;
- import org.hibernate.annotations.CascadeType;
- import javax.xml.bind.annotation.XmlRootElement;
- /**
- *
- * @author Arthur Gregorio
- *
- * @since 1.0
- * @version 1.0, 03/11/2011
- */
- @Entity
- @XmlRootElement
- @Table(name="subgrupo_produto")
- public class SubgrupoProduto implements Serializable {
- @Id
- @GeneratedValue(strategy= GenerationType.IDENTITY)
- @Column(name="subgrupo_id", unique=true, nullable=false)
- private int id;
- @Column(name="nome", length=90, nullable=false)
- private String nome;
- @Temporal(TemporalType.TIMESTAMP)
- @Column(name="data_inclusao", nullable=false)
- private Date dataInclusao;
- @Column(name="incluido_por", length=45, nullable=false)
- private String incluidoPor;
- @ManyToOne(fetch=FetchType.EAGER)
- @JoinColumn(name="grupo_id", insertable=true, updatable=true)
- @Cascade(CascadeType.ALL)
- private GrupoProduto grupo;
- @OneToMany(mappedBy="subgrupo", fetch=FetchType.LAZY)
- @Cascade(CascadeType.ALL)
- private List<Produto> produtos;
- public SubgrupoProduto() {
- this.id = 0;
- this.nome = null;
- this.dataInclusao = SQLClock.getTimestamp();
- this.incluidoPor = null;
- this.grupo = null;
- this.produtos = new ArrayList<Produto>();
- }
- /**
- * @return the id
- */
- public int getId() {
- return id;
- }
- /**
- * @param id the id to set
- */
- public void setId(int id) {
- this.id = id;
- }
- /**
- * @return the nome
- */
- public String getNome() {
- return nome;
- }
- /**
- * @param nome the nome to set
- */
- public void setNome(String nome) {
- this.nome = nome;
- }
- /**
- * @return the dataInclusao
- */
- public Date getDataInclusao() {
- return dataInclusao;
- }
- /**
- * @param dataInclusao the dataInclusao to set
- */
- public void setDataInclusao(Date dataInclusao) {
- this.dataInclusao = dataInclusao;
- }
- /**
- * @return the incluidoPor
- */
- public String getIncluidoPor() {
- return incluidoPor;
- }
- /**
- * @param incluidoPor the incluidoPor to set
- */
- public void setIncluidoPor(String incluidoPor) {
- this.incluidoPor = incluidoPor;
- }
- /**
- * @return the grupo
- */
- public GrupoProduto getGrupo() {
- return grupo;
- }
- /**
- * @param grupo the grupo to set
- */
- public void setGrupo(GrupoProduto grupo) {
- this.grupo = grupo;
- }
- /**
- * @return the produtos
- */
- public List<Produto> getProdutos() {
- return produtos;
- }
- /**
- * @param produtos the produtos to set
- */
- public void setProdutos(List<Produto> produtos) {
- this.produtos = produtos;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement