Kenmegne
6 days ago 908e81dd173f380879d5fabeb5794d5b7a76df0e
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
/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.megatim.fdxconvert.model;
 
import com.megatimfx.common.validationgroups.ViewFormValidationGroup;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.validation.constraints.NotEmpty;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
 
/**
 *
 * @author STEPHANIE
 */
@Entity
@Getter
@Setter
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class TypeFichier implements Serializable {
 
    @Id
    @NotEmpty(message = "Le code du type de fichier est obligatoire", groups = {ViewFormValidationGroup.class})
    private String code;
 
    @NotEmpty(message = "Le libellĂ© du type de fichier est obligatoire", groups = {ViewFormValidationGroup.class})
    @XmlTransient
    private String libelle;
 
    @NotEmpty(message = "Le code du participant est obligatoire", groups = {ViewFormValidationGroup.class})
    @XmlTransient
    private String codeParticipant;
 
    @OneToOne(mappedBy = "typeFichier", cascade = CascadeType.REMOVE)
    @XmlTransient
    private TypeFichierJson typeFichierJson;
 
    @CreationTimestamp
    @XmlTransient
    private LocalDateTime dateCreation;
 
    @UpdateTimestamp
    @XmlTransient
    private LocalDateTime dateMiseAJour;
 
    @Override
    public String toString() {
        return this.getCode();
    }
 
    @Override
    public boolean equals(Object obj) {
 
        if (this == obj) {
            return true;
        }
 
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof TypeFichier)) {
            return false;
        }
        final TypeFichier other = (TypeFichier) obj;
 
        if (this.getCode() != null && !this.getCode().equals(other.getCode())) {
            return false;
        }
        return true;
    }
 
    @Override
    public int hashCode() {
        int hash = 5;
        hash = 73 * hash + Objects.hashCode(this.code);
        hash = 73 * hash + Objects.hashCode(this.libelle);
        return hash;
    }
 
}