1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
| package com.source.entity;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
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.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
*
* @author sensoredab
*/
@Entity
@Table(name = "reference_produit")
@NamedQueries({
@NamedQuery(name = "SourceReferenceProduit.findAll", query = "SELECT s FROM SourceReferenceProduit s"),
@NamedQuery(name = "SourceReferenceProduit.findById", query = "SELECT s FROM SourceReferenceProduit s WHERE s.id = :id"),
@NamedQuery(name = "SourceReferenceProduit.findByMarque", query = "SELECT s FROM SourceReferenceProduit s WHERE s.marque = :marque"),
@NamedQuery(name = "SourceReferenceProduit.findByFormat", query = "SELECT s FROM SourceReferenceProduit s WHERE s.format = :format"),
@NamedQuery(name = "SourceReferenceProduit.findByUsine", query = "SELECT s FROM SourceReferenceProduit s WHERE s.usine = :usine"),
@NamedQuery(name = "SourceReferenceProduit.findByCodeSanitaire", query = "SELECT s FROM SourceReferenceProduit s WHERE s.codeSanitaire = :codeSanitaire"),
@NamedQuery(name = "SourceReferenceProduit.findByUnivers", query = "SELECT s FROM SourceReferenceProduit s WHERE s.univers = :univers"),
@NamedQuery(name = "SourceReferenceProduit.findByNom", query = "SELECT s FROM SourceReferenceProduit s WHERE s.nom = :nom")})
public class SourceReferenceProduit implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Column(name = "marque")
private String marque;
@Column(name = "format")
private String format;
@Column(name = "usine")
private String usine;
@Column(name = "code_sanitaire")
private String codeSanitaire;
@Column(name = "univers")
private String univers;
@Column(name = "nom")
private String nom;
@OneToMany(fetch = FetchType.LAZY ,mappedBy = "sourceReferenceProduit")
private Collection<SourceProduit> sourceProduitCollection;
public SourceReferenceProduit() {
}
public SourceReferenceProduit(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getMarque() {
return marque;
}
public void setMarque(String marque) {
this.marque = marque;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
this.format = format;
}
public String getUsine() {
return usine;
}
public void setUsine(String usine) {
this.usine = usine;
}
public String getCodeSanitaire() {
return codeSanitaire;
}
public void setCodeSanitaire(String codeSanitaire) {
this.codeSanitaire = codeSanitaire;
}
public String getUnivers() {
return univers;
}
public void setUnivers(String univers) {
this.univers = univers;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public Collection<SourceProduit> getSourceProduitCollection() {
return sourceProduitCollection;
}
public void setSourceProduitCollection(Collection<SourceProduit> sourceProduitCollection) {
this.sourceProduitCollection = sourceProduitCollection;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.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 SourceReferenceProduit)) {
return false;
}
SourceReferenceProduit other = (SourceReferenceProduit) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.source.entity.SourceReferenceProduit[id=" + id + "]";
}
} |
Partager