86 lines
1.7 KiB
Java
86 lines
1.7 KiB
Java
package eu.eudat.migration.entities;
|
|
|
|
import javax.persistence.*;
|
|
import java.util.Date;
|
|
import java.util.HashSet;
|
|
import java.util.Set;
|
|
|
|
@Entity
|
|
@Table(name = "research_domains")
|
|
public class ResearchDomain {
|
|
|
|
@Id
|
|
private Long id;
|
|
private String identifier;
|
|
private String label;
|
|
@OneToMany(fetch = FetchType.EAGER)
|
|
@JoinColumn(name = "parent_id")
|
|
private Set<ResearchDomain> subFields = new HashSet<>();
|
|
@Column(name = "created_at")
|
|
@Temporal(TemporalType.TIMESTAMP)
|
|
private Date createdAt;
|
|
@Column(name = "updated_at")
|
|
@Temporal(TemporalType.TIMESTAMP)
|
|
private Date updatedAt;
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "ResearchDomain{" +
|
|
"id=" + id +
|
|
", identifier='" + identifier + '\'' +
|
|
", label='" + label + '\'' +
|
|
", subFields=" + subFields +
|
|
", createdAt=" + createdAt +
|
|
", updatedAt=" + updatedAt +
|
|
'}';
|
|
}
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getIdentifier() {
|
|
return identifier;
|
|
}
|
|
|
|
public void setIdentifier(String identifier) {
|
|
this.identifier = identifier;
|
|
}
|
|
|
|
public String getLabel() {
|
|
return label;
|
|
}
|
|
|
|
public void setLabel(String label) {
|
|
this.label = label;
|
|
}
|
|
|
|
public Set<ResearchDomain> getSubFields() {
|
|
return subFields;
|
|
}
|
|
|
|
public void setSubFields(Set<ResearchDomain> subFields) {
|
|
this.subFields = subFields;
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|