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.util.ArrayList;
- import java.io.Serializable;
- import javax.persistence.Id;
- import javax.persistence.Table;
- import javax.persistence.Column;
- import javax.persistence.Entity;
- import javax.persistence.Temporal;
- import javax.persistence.FetchType;
- import javax.persistence.OneToMany;
- 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="grupo_produto")
- public class GrupoProduto implements Serializable {
- @Id
- @GeneratedValue(strategy= GenerationType.IDENTITY)
- @Column(name="grupo_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;
- @OneToMany(mappedBy="grupo", fetch=FetchType.LAZY)
- @Cascade(CascadeType.ALL)
- private List<SubgrupoProduto> subgrupos;
- public GrupoProduto() {
- this.id = 0;
- this.nome = null;
- this.dataInclusao = SQLClock.getTimestamp();
- this.incluidoPor = null;
- this.subgrupos = new ArrayList<SubgrupoProduto>();
- }
- /**
- * @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 subgrupos
- */
- public List<SubgrupoProduto> getSubgrupos() {
- return subgrupos;
- }
- /**
- * @param subgrupos the subgrupos to set
- */
- public void setSubgrupos(List<SubgrupoProduto> subgrupos) {
- this.subgrupos = subgrupos;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement