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
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
package com.megatim.fdxconsultation.model.configuration;
 
import com.megatim.fdxcommons.model.enumeration.TypeOperation;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import lombok.Getter;
import lombok.Setter;
 
/**
 *
 * @author DYNABOOK
 */
@Getter
@Setter
@Entity(name = "CodeStatutHttp")
@Table(name = "FDX_CODE_STATUT_HTTP")
public class CodeStatutHttp implements Comparable<CodeStatutHttp>, Serializable {
 
    @SequenceGenerator(name = "SEQ_FDX_CODE_STATUT_HTTP",
            sequenceName = "SEQ_FDX_CODE_STATUT_HTTP",
            allocationSize = 1,
            initialValue = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_FDX_CODE_STATUT_HTTP")
    @Column(name = "ID")
    @Id
    private Long id;
 
    @Column(name = "ID_GENERER")
    protected String idGenerer;
 
    @Column(name = "CODE")
    private String code;
    
    @Column(nullable = false, name = "LIBELLE")
    private String libelle;
 
    @Column(name = "TYPE_OPERATION")
    private TypeOperation typeOperation = TypeOperation.AJOUTER;
 
    @Column(name = "DATE_CREATION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateCreation;
 
    @Column(name = "USER_CREATION")
    private String utilisateurCreation;
 
    @Column(name = "DATE_DERN_MOD")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateDerniereModification;
 
    @Column(name = "USER_UPDATE")
    private String utilisateurModification;
 
    @Column(name = "DATE_SUPPR")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateSuppression;
 
    @Column(name = "USER_DELETE")
    private String utilisateurSuppression;
    
    @Transient
    private int nbreUtilisateur;
 
    public CodeStatutHttp() {}
 
    public CodeStatutHttp(String code, String libelle) {
        this.code = code;
        this.libelle = libelle;
    }
 
    @Override
    public int hashCode() {
        int hash = 7;
        hash = 11 * hash + Objects.hashCode(this.id);
        return hash;
    }
 
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final CodeStatutHttp other = (CodeStatutHttp) obj;
        if (!Objects.equals(this.id, other.id)) {
            return false;
        }
        return true;
    }
 
    /*
     * (non-Javadoc)
     * @see java.lang.Comparable#compareTo(java.lang.Object)
     */
    @Override
    public int compareTo(CodeStatutHttp parameter) {
        if (parameter == null) {
            return -1;
        }
        if (parameter.code == null || parameter.code.trim().length() == 0) {
            return -1;
        }
        if (code == null || code.trim().length() == 0) {
            return 1;
        }
        return code.compareTo(parameter.code);
    }
}