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 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
| package com.bean.ModuleExigence.Livrable.entities;
import com.bean.ModuleProjet.User.entitites.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
@Entity
@NamedQueries( {
@NamedQuery(name = "findAllLivrable", query = "SELECT ct FROM Livrable ct"),
@NamedQuery(name="RechercheParProjet",query="SELECT NEW com.bean.ModuleProjet.User.entitites.GestionRisqueExigence(l.LivrableName, p.ProjetName, l.DateCRTLivrable, l.DateLivraison, l.Nature, l.type, l.status) FROM Livrable l ,Projet p WHERE p.ProjetID=l.projets AND p.ProjetID= :ProjetID")
} )
public class Livrable implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private int LivrableID;
private String LivrableName;
private String LivrableDescription;
@Temporal(javax.persistence.TemporalType.DATE)
private Date DateCRTLivrable;
@Temporal(javax.persistence.TemporalType.DATE)
private Date DateLivraison;
private String Nature;
private String type;
private String status;
@JoinColumn(name="VersionLivID_fk", nullable=false)
@ManyToOne(fetch=FetchType.LAZY)
private Version_Liv Version;
@JoinColumn(name="ProjetID_fk", nullable=false)
@ManyToOne(fetch=FetchType.LAZY)
private Projet projets;
@OneToMany(mappedBy ="livra")
private List<Historique_Liv> LivHistory;
@OneToMany
@JoinTable(name="Projet_Livrable",
joinColumns = {@JoinColumn(name = "ProjetID")},
inverseJoinColumns = {@JoinColumn(name = "LivrableID")})
private List<Projet> projet;
public Livrable(){}
public Livrable(int LivrableID, String LivrableName, String LivrableDescription, Date DateCRTLivrable, Date DateLivraison, String Nature, String type, String status, Version_Liv Version, Projet projets, List<Historique_Liv> LivHistory, List<Projet> projet) {
this.LivrableID = LivrableID;
this.LivrableName = LivrableName;
this.LivrableDescription = LivrableDescription;
this.DateCRTLivrable = DateCRTLivrable;
this.DateLivraison = DateLivraison;
this.Nature = Nature;
this.type = type;
this.status = status;
this.Version = Version;
this.projets = projets;
this.LivHistory = LivHistory;
this.projet = projet;
}
public int getLivrableID() {
return LivrableID;
}
public void setLivrableID(int livrableID) {
LivrableID = livrableID;
}
public String getLivrableName() {
return LivrableName;
}
public void setLivrableName(String livrableName) {
LivrableName = livrableName;
}
public String getLivrableDescription() {
return LivrableDescription;
}
public void setLivrableDescription(String livrableDescription) {
LivrableDescription = livrableDescription;
}
public Date getDateCRTLivrable() {
return DateCRTLivrable;
}
public void setDateCRTLivrable(Date DateCRTLivrable) {
this.DateCRTLivrable = DateCRTLivrable;
}
public Date getDateLivraison() {
return DateLivraison;
}
public void setDateLivraison(Date DateLivraison) {
this.DateLivraison = DateLivraison;
}
public Projet getProjets() {
return projets;
}
public void setProjets(Projet projets) {
this.projets = projets;
}
public List<Historique_Liv> getLivHistory() {
return LivHistory;
}
public void setLivHistory(List<Historique_Liv> LivHistory) {
this.LivHistory = LivHistory;
}
public Version_Liv getVersion() {
return Version;
}
public void setVersion(Version_Liv Version) {
this.Version = Version;
}
public List<Projet> getProjet() {
return projet;
}
public void setProjet(List<Projet> projet) {
this.projet = projet;
}
public String getNature() {
return Nature;
}
public void setNature(String Nature) {
this.Nature = Nature;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public String toString() {
return "Livrable{" + "LivrableID=" + LivrableID + "LivrableName=" + LivrableName + "LivrableDescription=" + LivrableDescription + "DateCRTLivrable=" + DateCRTLivrable + "DateLivraison=" + DateLivraison + "Nature=" + Nature + "type=" + type + "status=" + status + "Version=" + Version + "projets=" + projets + "LivHistory=" + LivHistory + "projet=" + projet + '}';
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Livrable other = (Livrable) obj;
if (this.LivrableID != other.LivrableID) {
return false;
}
if ((this.LivrableName == null) ? (other.LivrableName != null) : !this.LivrableName.equals(other.LivrableName)) {
return false;
}
if ((this.LivrableDescription == null) ? (other.LivrableDescription != null) : !this.LivrableDescription.equals(other.LivrableDescription)) {
return false;
}
if (this.DateCRTLivrable != other.DateCRTLivrable && (this.DateCRTLivrable == null || !this.DateCRTLivrable.equals(other.DateCRTLivrable))) {
return false;
}
if (this.DateLivraison != other.DateLivraison && (this.DateLivraison == null || !this.DateLivraison.equals(other.DateLivraison))) {
return false;
}
if ((this.Nature == null) ? (other.Nature != null) : !this.Nature.equals(other.Nature)) {
return false;
}
if ((this.type == null) ? (other.type != null) : !this.type.equals(other.type)) {
return false;
}
if ((this.status == null) ? (other.status != null) : !this.status.equals(other.status)) {
return false;
}
if (this.Version != other.Version && (this.Version == null || !this.Version.equals(other.Version))) {
return false;
}
if (this.projets != other.projets && (this.projets == null || !this.projets.equals(other.projets))) {
return false;
}
if (this.LivHistory != other.LivHistory && (this.LivHistory == null || !this.LivHistory.equals(other.LivHistory))) {
return false;
}
if (this.projet != other.projet && (this.projet == null || !this.projet.equals(other.projet))) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 37 * hash + this.LivrableID;
hash = 37 * hash + (this.LivrableName != null ? this.LivrableName.hashCode() : 0);
hash = 37 * hash + (this.LivrableDescription != null ? this.LivrableDescription.hashCode() : 0);
hash = 37 * hash + (this.DateCRTLivrable != null ? this.DateCRTLivrable.hashCode() : 0);
hash = 37 * hash + (this.DateLivraison != null ? this.DateLivraison.hashCode() : 0);
hash = 37 * hash + (this.Nature != null ? this.Nature.hashCode() : 0);
hash = 37 * hash + (this.type != null ? this.type.hashCode() : 0);
hash = 37 * hash + (this.status != null ? this.status.hashCode() : 0);
hash = 37 * hash + (this.Version != null ? this.Version.hashCode() : 0);
hash = 37 * hash + (this.projets != null ? this.projets.hashCode() : 0);
hash = 37 * hash + (this.LivHistory != null ? this.LivHistory.hashCode() : 0);
hash = 37 * hash + (this.projet != null ? this.projet.hashCode() : 0);
return hash;
}
} |
Partager