Kenmegne
7 days ago 23a46b4be35277e06ec89f48730eeb694e686be8
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
package com.megatim.fdxcommons.model.referentiel;
 
import com.megatim.fdxcommons.model.enumeration.TypeExtension;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import com.megatim.fdxcommons.model.search.CriteriaEntitySearch;
 
/**
 *
 * @author ASUS
 */
@Entity
@Getter
@Setter
@XmlRootElement(name = "extensionFichiers")
@XmlAccessorType(XmlAccessType.FIELD)
@NoArgsConstructor
public class ExtensionFichier implements Serializable {
 
    @Id
    @NotEmpty(message = "Extension du fichier obligatoire")
    @CriteriaEntitySearch(libelle = "Extension", rang = 1)
    private String extension;
 
    @NotEmpty(message = "Le libellé du fichier est obligatoire")
    @CriteriaEntitySearch(libelle = "Libellé", rang = 2)
    private String libelle;
 
    @Enumerated(EnumType.STRING)
    @NotNull(message = "Le type d'extension du fichier est obligatoire")
    @CriteriaEntitySearch(libelle = "Type extension", rang = 3)
    private TypeExtension typeExtension;
 
    @NotNull(message = "L'extension de fichier doit être associée à un réfrérentiel en préparation")
    @ManyToOne
    @CriteriaEntitySearch(libelle = "Référentiel", fieldName = "referentiel.version", rang = 4)
    private Referentiel referentiel;
 
    @XmlJavaTypeAdapter(LocalDateTimeAdapter.class)
    private LocalDateTime dateCreation;
 
    @XmlJavaTypeAdapter(LocalDateTimeAdapter.class)
    private LocalDateTime dateMiseAjour;
 
    private String createBy;
 
    private String lastModifiedBy;
 
    @Override
    public String toString() {
        return this.getLibelle() + " (" + this.getExtension() + ")";
    }
 
    @Override
    public int hashCode() {
        int hash = 7;
        hash = 53 * hash + Objects.hashCode(this.extension);
        return hash;
    }
 
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof ExtensionFichier)) {
            return false;
        }
        ExtensionFichier other = (ExtensionFichier) obj;
        if (this.getExtension() != null && !this.getExtension().equals(other.getExtension())) {
            return false;
        }
        return true;
    }
}