Kenmegne
7 days ago b3d0580439b9a00c7eb918085de1694151066004
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
package com.megatim.fdxconvert.model;
 
import com.megatim.fdxconvert.pojo.Delimiteur;
import com.megatimfx.common.validationgroups.ViewFormValidationGroup;
import com.megatim.fdxconvert.enums.DataType;
import com.megatim.fdxconvert.model.constraint.DelimiterConstraint;
import com.megatim.fdxconvert.model.constraint.SchedulerConstraint;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
 
@Entity
@Table(name = "CONVERT_TACHE")
@Getter
@Setter
@SchedulerConstraint(groups = {ViewFormValidationGroup.class})
@DelimiterConstraint(groups = {ViewFormValidationGroup.class})
public class Tache implements Serializable {
 
    @Id
    @NotEmpty(message = "Le libelle est obligatoire", groups = {ViewFormValidationGroup.class})
    private String libelle;
 
    private boolean active;
 
    //PLANNICATION
    private int heureTache = 0;
    private int minuteTache = 0;
    private int intervalleTache = 0;
 
    private boolean withoutInterval;
 
    private boolean monday;
    private boolean tuesday;
    private boolean wednesday;
    private boolean thursday;
    private boolean friday;
    private boolean saturday;
    private boolean sunday;
 
    private int intervalleExecution;
 
    private boolean executeOnce;
 
    @NotEmpty(message = "Le repertoire source est obligatoire", groups = {ViewFormValidationGroup.class})
    private String repertoireSource;
 
    @NotEmpty(message = "Le repertoire de destination est obligatoire", groups = {ViewFormValidationGroup.class})
    private String repertoireDestination;
 
    @NotEmpty(message = "Le repertoire des erreurs est obligatoire", groups = {ViewFormValidationGroup.class})
    private String repertoireErreur;
 
    @ManyToOne
    @JoinColumn(name = "typefichier_code")
    @NotNull(message = "Le typefichier est obligatoire", groups = {ViewFormValidationGroup.class})
    private TypeFichier typeFichier;
 
    private boolean withHeader;
 
    private boolean strictValidation;
 
    @Transient
    private Delimiteur delimiteurLigne;
    
    @Transient
    private Delimiteur delimiteurColonne;
    
    private String rowDeliminter;
 
    private String colDeliminter;
 
    @NotNull(message = "Le format de fichier de donnĂ©es est obligatoire", groups = {ViewFormValidationGroup.class})
    private DataType dataType;
    
    @CreationTimestamp
    private LocalDateTime dateCreation;
    
    @UpdateTimestamp
    private LocalDateTime dateMiseAJour;
 
    @OneToMany(mappedBy = "tache", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    private Set<MetaAlphaNumeriqueField> metaAlphaNumeriqueFields = new HashSet<>();
 
    @Override
    public String toString() {
        return libelle;
    }
 
    @Override
    public boolean equals(Object obj) {
        
        if (this == obj) {
            return true;
        }
        
        if (obj == null) {
            return false;
        }
        
        if (!(obj instanceof Tache)) {
            return false;
        }
        
        final Tache other = (Tache) obj;
        
        if (this.getLibelle() != null && !this.getLibelle().equals(other.getLibelle())) {
            return false;
        }
        
        return true;
    }
 
}