2023-06-28 15:28:12 +02:00
|
|
|
package eu.dnetlib.openaire.community.model;
|
2023-06-12 14:30:42 +02:00
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
|
|
|
import javax.persistence.Column;
|
|
|
|
import javax.persistence.Entity;
|
|
|
|
import javax.persistence.Id;
|
|
|
|
import javax.persistence.IdClass;
|
|
|
|
import javax.persistence.Table;
|
|
|
|
|
2023-06-19 15:47:48 +02:00
|
|
|
import org.hibernate.annotations.Type;
|
|
|
|
|
|
|
|
import eu.dnetlib.openaire.exporter.model.community.selectioncriteria.SelectionCriteria;
|
|
|
|
|
2023-06-12 14:30:42 +02:00
|
|
|
@Entity
|
|
|
|
@Table(name = "community_datasources")
|
2023-06-14 13:53:59 +02:00
|
|
|
@IdClass(DbDatasourcePK.class)
|
|
|
|
public class DbDatasource implements Serializable {
|
2023-06-12 14:30:42 +02:00
|
|
|
|
2023-06-20 10:48:53 +02:00
|
|
|
private static final long serialVersionUID = -8782576185861694228L;
|
2023-06-12 14:30:42 +02:00
|
|
|
|
|
|
|
@Id
|
|
|
|
@Column(name = "community")
|
|
|
|
private String community;
|
|
|
|
|
|
|
|
@Id
|
|
|
|
@Column(name = "ds_id")
|
|
|
|
private String dsId;
|
|
|
|
|
|
|
|
@Column(name = "ds_name")
|
|
|
|
private String dsName;
|
|
|
|
|
2023-06-19 15:47:48 +02:00
|
|
|
@Column(name = "ds_officialname")
|
|
|
|
private String dsOfficialName;
|
|
|
|
|
2023-10-09 12:12:07 +02:00
|
|
|
@Column(name = "enabled")
|
|
|
|
private Boolean enabled;
|
|
|
|
|
2023-06-19 15:47:48 +02:00
|
|
|
@Type(type = "jsonb")
|
|
|
|
@Column(name = "constraints")
|
|
|
|
private SelectionCriteria constraints;
|
|
|
|
|
2023-06-14 13:53:59 +02:00
|
|
|
public DbDatasource() {}
|
2023-06-12 14:30:42 +02:00
|
|
|
|
2023-06-19 15:47:48 +02:00
|
|
|
public DbDatasource(final String community, final String dsId, final String dsName, final String dsOfficialName, final SelectionCriteria constraints) {
|
2023-06-12 14:30:42 +02:00
|
|
|
this.community = community;
|
|
|
|
this.dsId = dsId;
|
|
|
|
this.dsName = dsName;
|
2023-06-19 15:47:48 +02:00
|
|
|
this.dsOfficialName = dsOfficialName;
|
|
|
|
this.constraints = constraints;
|
2023-06-12 14:30:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public String getCommunity() {
|
|
|
|
return community;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCommunity(final String community) {
|
|
|
|
this.community = community;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getDsId() {
|
|
|
|
return dsId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDsId(final String dsId) {
|
|
|
|
this.dsId = dsId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getDsName() {
|
|
|
|
return dsName;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDsName(final String dsName) {
|
|
|
|
this.dsName = dsName;
|
|
|
|
}
|
|
|
|
|
2023-06-19 15:47:48 +02:00
|
|
|
public String getDsOfficialName() {
|
|
|
|
return dsOfficialName;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDsOfficialName(final String dsOfficialName) {
|
|
|
|
this.dsOfficialName = dsOfficialName;
|
|
|
|
}
|
|
|
|
|
2023-10-09 12:12:07 +02:00
|
|
|
public Boolean getEnabled() {
|
|
|
|
return enabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setEnabled(final Boolean enabled) {
|
|
|
|
this.enabled = enabled;
|
|
|
|
}
|
|
|
|
|
2023-06-19 15:47:48 +02:00
|
|
|
public SelectionCriteria getConstraints() {
|
|
|
|
return constraints;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setConstraints(final SelectionCriteria constraints) {
|
|
|
|
this.constraints = constraints;
|
|
|
|
}
|
|
|
|
|
2023-06-12 14:30:42 +02:00
|
|
|
}
|