package com.megatim.fdxconsultation.model.stats;
|
|
import com.megatim.fdxcommons.model.enumeration.TypeDonnee;
|
import com.megatim.fdxconsultation.model.base.BaseEntity;
|
import java.io.Serializable;
|
import java.util.Objects;
|
import javax.persistence.Entity;
|
import javax.persistence.EnumType;
|
import javax.persistence.Enumerated;
|
import javax.persistence.GeneratedValue;
|
import javax.persistence.GenerationType;
|
import javax.persistence.Id;
|
import javax.persistence.ManyToOne;
|
import javax.persistence.SequenceGenerator;
|
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotNull;
|
import lombok.AllArgsConstructor;
|
import lombok.Getter;
|
import lombok.NoArgsConstructor;
|
import lombok.Setter;
|
|
/**
|
*
|
* @author ASUS
|
*/
|
@Getter
|
@Setter
|
@Entity
|
@NoArgsConstructor
|
@AllArgsConstructor
|
public class TableauBordColumn extends BaseEntity implements Serializable {
|
|
@Id
|
@SequenceGenerator(name = "SEQ_TABLEAU_BORD_COLUMN",
|
sequenceName = "SEQ_TABLEAU_BORD_COLUMN",
|
allocationSize = 1,
|
initialValue = 1)
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_TABLEAU_BORD_COLUMN")
|
private Long id;
|
|
@NotEmpty(message = "Le nom de la colonne est obligatoire")
|
private String name;
|
|
@NotNull(message = "Le type de données est obligatoire")
|
@Enumerated(EnumType.STRING)
|
private TypeDonnee typeDonnee;
|
|
@ManyToOne
|
private TableConfiguration tableConfiguration;
|
|
@Override
|
public int hashCode() {
|
int hash = 7;
|
hash = 37 * hash + Objects.hashCode(this.name);
|
hash = 37 * hash + Objects.hashCode(this.typeDonnee);
|
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 TableauBordColumn other = (TableauBordColumn) obj;
|
if (!Objects.equals(this.name, other.name)) {
|
return false;
|
}
|
return this.typeDonnee == other.typeDonnee;
|
}
|
}
|