120 lines
2.6 KiB
Java
120 lines
2.6 KiB
Java
package eu.eudat.migration.entities;
|
|
|
|
import eu.eudat.migration.utils.ArrayTypeConverter;
|
|
import eu.eudat.migration.utils.JsonTypeConverter;
|
|
|
|
import javax.persistence.*;
|
|
import java.util.Arrays;
|
|
import java.util.Date;
|
|
import java.util.Map;
|
|
|
|
@Entity
|
|
@Table(name = "conditions")
|
|
@SuppressWarnings("JpaAttributeTypeInspection")
|
|
public class Condition {
|
|
|
|
@Id
|
|
private Long id;
|
|
@Column(name = "option_list")
|
|
@Convert(converter = ArrayTypeConverter.class)
|
|
private String[] optionList;
|
|
@Column(name = "action_type")
|
|
private ActionType actionType;
|
|
private Long number;
|
|
@Column(name = "remove_data")
|
|
@Convert(converter = ArrayTypeConverter.class)
|
|
private String[] removeData;
|
|
@Column(name = "webhook_data")
|
|
@Convert(converter = JsonTypeConverter.class)
|
|
private Map<String, Object> webhookData;
|
|
@Column(name = "created_at")
|
|
@Temporal(TemporalType.TIMESTAMP)
|
|
private Date createdAt;
|
|
@Column(name = "updated_at")
|
|
@Temporal(TemporalType.TIMESTAMP)
|
|
private Date updatedAt;
|
|
|
|
public enum ActionType {
|
|
REMOVE,
|
|
ADD_WEBHOOK
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "Condition{" +
|
|
"id=" + id +
|
|
", optionList=" + Arrays.toString(optionList) +
|
|
", actionType=" + actionType +
|
|
", number=" + number +
|
|
", removeData=" + Arrays.toString(removeData) +
|
|
", webhookData=" + webhookData +
|
|
", createdAt=" + createdAt +
|
|
", updatedAt=" + updatedAt +
|
|
'}';
|
|
}
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String[] getOptionList() {
|
|
return optionList;
|
|
}
|
|
|
|
public void setOptionList(String[] optionList) {
|
|
this.optionList = optionList;
|
|
}
|
|
|
|
public ActionType getActionType() {
|
|
return actionType;
|
|
}
|
|
|
|
public void setActionType(ActionType actionType) {
|
|
this.actionType = actionType;
|
|
}
|
|
|
|
public Long getNumber() {
|
|
return number;
|
|
}
|
|
|
|
public void setNumber(Long number) {
|
|
this.number = number;
|
|
}
|
|
|
|
public String[] getRemoveData() {
|
|
return removeData;
|
|
}
|
|
|
|
public void setRemoveData(String[] removeData) {
|
|
this.removeData = removeData;
|
|
}
|
|
|
|
public Map<String, Object> getWebhookData() {
|
|
return webhookData;
|
|
}
|
|
|
|
public void setWebhookData(Map<String, Object> webhookData) {
|
|
this.webhookData = webhookData;
|
|
}
|
|
|
|
public Date getCreatedAt() {
|
|
return createdAt;
|
|
}
|
|
|
|
public void setCreatedAt(Date createdAt) {
|
|
this.createdAt = createdAt;
|
|
}
|
|
|
|
public Date getUpdatedAt() {
|
|
return updatedAt;
|
|
}
|
|
|
|
public void setUpdatedAt(Date updatedAt) {
|
|
this.updatedAt = updatedAt;
|
|
}
|
|
}
|