Commit 67a4f8f0 authored by Matija Obreza's avatar Matija Obreza
Browse files

Accession @OneToOne to All* entities, REST upsert updates Collecting

information
parent 82c12b62
......@@ -253,8 +253,7 @@ public class Accession implements java.io.Serializable {
this.genus = genuss;
}
@OneToOne
@JoinColumn(name = "id", referencedColumnName = "ALIS_Id")
@OneToOne(optional = true, cascade = { CascadeType.ALL }, mappedBy = "accession")
public AllAccnames getAccessionNames() {
return accessionNames;
}
......@@ -263,8 +262,7 @@ public class Accession implements java.io.Serializable {
this.accessionNames = accessionNames;
}
@OneToOne
@JoinColumn(name = "id", referencedColumnName = "ALIS_Id")
@OneToOne(optional = true, cascade = { CascadeType.ALL }, mappedBy = "accession")
public AllAcqBreeding getAccessionBreeding() {
return accessionBreeding;
}
......@@ -273,8 +271,7 @@ public class Accession implements java.io.Serializable {
this.accessionBreeding = accessionBreeding;
}
@OneToOne
@JoinColumn(name = "id", referencedColumnName = "ALIS_Id")
@OneToOne(optional = true, cascade = { CascadeType.ALL }, mappedBy = "accession")
public AllAcqCollect getAccessionCollection() {
return accessionCollection;
}
......@@ -283,8 +280,7 @@ public class Accession implements java.io.Serializable {
this.accessionCollection = accessionCollection;
}
@OneToOne
@JoinColumn(name = "id", referencedColumnName = "ALIS_Id")
@OneToOne(optional = true, cascade = { CascadeType.ALL }, mappedBy = "accession")
public AllAcqExchange getAccessionExchange() {
return accessionExchange;
}
......@@ -293,8 +289,7 @@ public class Accession implements java.io.Serializable {
this.accessionExchange = accessionExchange;
}
@OneToOne
@JoinColumn(name = "id", referencedColumnName = "ALIS_Id")
@OneToOne(optional = true, cascade = { CascadeType.ALL }, mappedBy = "accession")
public AllEnvironment getAccessionEnvironment() {
return accessionEnvironment;
}
......
......@@ -20,50 +20,69 @@ package org.genesys2.server.model.genesys;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.MapsId;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Version;
/**
* AllAccnames generated by hbm2java
*/
@Entity
@Table(name = "accnames")
public class AllAccnames implements java.io.Serializable {
public class AllAccnames {
/**
*
*/
private static final long serialVersionUID = -2785898802497223245L;
private long alisId;
@Id
@Column(name = "ALIS_Id")
private Long id;
@Version
private long version = 0;
@MapsId
@OneToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumn(name = "ALIS_Id", unique = true, nullable = false, updatable = false)
private Accession accession;
@Column(name = "AccNames")
@Lob
private String accNames;
@Column(name = "OtherIds")
@Lob
private String otherIds;
public AllAccnames() {
}
public AllAccnames(final int alisId) {
this.alisId = alisId;
public Long getId() {
return id;
}
public AllAccnames(final int alisId, final String accNames, final String otherIds) {
this.alisId = alisId;
this.accNames = accNames;
this.otherIds = otherIds;
public void setId(Long id) {
this.id = id;
}
@Id
@Column(name = "ALIS_Id", unique = true, nullable = false)
public long getAlisId() {
return this.alisId;
public long getVersion() {
return version;
}
public void setAlisId(final long alisId) {
this.alisId = alisId;
public void setVersion(long version) {
this.version = version;
}
public Accession getAccession() {
return accession;
}
public void setAccession(Accession accession) {
this.accession = accession;
}
@Column(name = "AccNames")
@Lob
public String getAccNames() {
return this.accNames;
}
......@@ -72,8 +91,6 @@ public class AllAccnames implements java.io.Serializable {
this.accNames = accNames;
}
@Column(name = "OtherIds")
@Lob
public String getOtherIds() {
return this.otherIds;
}
......
......@@ -20,49 +20,68 @@ package org.genesys2.server.model.genesys;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.MapsId;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Version;
/**
* AllAcqBreeding generated by hbm2java
*/
@Entity
@Table(name = "acq_breeding")
public class AllAcqBreeding implements java.io.Serializable {
public class AllAcqBreeding {
/**
*
*/
private static final long serialVersionUID = 2762545036218363406L;
private long alisId;
@Id
@Column(name = "ALIS_Id")
private Long id;
@Version
private long version = 0;
@MapsId
@OneToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumn(name = "ALIS_Id", unique = true, nullable = false, updatable = false)
private Accession accession;
@Column(name = "Breeder_Code", length = 8)
private String breederCode;
@Column(name = "Pedigree")
@Lob
private String pedigree;
public AllAcqBreeding() {
}
public AllAcqBreeding(final int alisId) {
this.alisId = alisId;
public Long getId() {
return id;
}
public AllAcqBreeding(final int alisId, final String breederCode, final String pedigree) {
this.alisId = alisId;
this.breederCode = breederCode;
this.pedigree = pedigree;
public void setId(Long id) {
this.id = id;
}
@Id
@Column(name = "ALIS_Id", unique = true, nullable = false)
public long getAlisId() {
return this.alisId;
public long getVersion() {
return version;
}
public void setAlisId(final long alisId) {
this.alisId = alisId;
public void setVersion(long version) {
this.version = version;
}
public Accession getAccession() {
return accession;
}
public void setAccession(Accession accession) {
this.accession = accession;
}
@Column(name = "Breeder_Code", length = 8)
public String getBreederCode() {
return this.breederCode;
}
......@@ -71,8 +90,6 @@ public class AllAcqBreeding implements java.io.Serializable {
this.breederCode = breederCode;
}
@Column(name = "Pedigree")
@Lob
public String getPedigree() {
return this.pedigree;
}
......
......@@ -20,52 +20,75 @@ package org.genesys2.server.model.genesys;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.MapsId;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Version;
/**
* AllAcqCollect generated by hbm2java
*/
@Entity
@Table(name = "acq_collect")
public class AllAcqCollect implements java.io.Serializable {
public class AllAcqCollect {
/**
*
*/
private static final long serialVersionUID = 516402638057331415L;
private long alisId;
@Id
@Column(name = "ALIS_Id")
private Long id;
@Version
private long version = 0;
@MapsId
@OneToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumn(name = "ALIS_Id", unique = true, nullable = false, updatable = false)
private Accession accession;
@Column(name = "Collect_Date", length = 8)
private String collectDate;
@Column(name = "Collectors_Numb", length = 24)
private String collectorsNumb;
@Column(name = "Collecting_Institute", length = 8)
private String collectingInstitute;
@Column(name = "Collect_Site")
@Lob
private String collectSite;
public AllAcqCollect() {
}
public AllAcqCollect(final long alisId) {
this.alisId = alisId;
public Long getId() {
return id;
}
public AllAcqCollect(final long alisId, final String collectDate, final String collectorsNumb, final String collectingInstitute, final String collectSite) {
this.alisId = alisId;
this.collectDate = collectDate;
this.collectorsNumb = collectorsNumb;
this.collectingInstitute = collectingInstitute;
this.collectSite = collectSite;
public void setId(Long id) {
this.id = id;
}
@Id
@Column(name = "ALIS_Id", unique = true, nullable = false)
public long getAlisId() {
return this.alisId;
public long getVersion() {
return version;
}
public void setAlisId(final long alisId) {
this.alisId = alisId;
public void setVersion(long version) {
this.version = version;
}
public Accession getAccession() {
return accession;
}
public void setAccession(Accession accession) {
this.accession = accession;
}
@Column(name = "Collect_Date", length = 8)
public String getCollectDate() {
return this.collectDate;
}
......@@ -74,7 +97,6 @@ public class AllAcqCollect implements java.io.Serializable {
this.collectDate = collectDate;
}
@Column(name = "Collectors_Numb", length = 24)
public String getCollectorsNumb() {
return this.collectorsNumb;
}
......@@ -83,7 +105,6 @@ public class AllAcqCollect implements java.io.Serializable {
this.collectorsNumb = collectorsNumb;
}
@Column(name = "Collecting_Institute", length = 8)
public String getCollectingInstitute() {
return this.collectingInstitute;
}
......@@ -92,7 +113,6 @@ public class AllAcqCollect implements java.io.Serializable {
this.collectingInstitute = collectingInstitute;
}
@Column(name = "Collect_Site", length = 16777215)
public String getCollectSite() {
return this.collectSite;
}
......
......@@ -20,48 +20,69 @@ package org.genesys2.server.model.genesys;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.MapsId;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Version;
/**
* AllAcqExchange generated by hbm2java
*/
@Entity
@Table(name = "acq_exchange")
public class AllAcqExchange implements java.io.Serializable {
public class AllAcqExchange {
/**
*
*/
private static final long serialVersionUID = 2242341437805807473L;
private long alisId;
@Id
@Column(name = "ALIS_Id")
private Long id;
@Version
private long version = 0;
@MapsId
@OneToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumn(name = "ALIS_Id", unique = true, nullable = false, updatable = false)
private Accession accession;
@Column(name = "Donor_Institute", length = 8)
private String donorInstitute;
@Column(name = "Acc_Numb_Donor", length = 36)
private String accNumbDonor;
public AllAcqExchange() {
}
public AllAcqExchange(final int alisId) {
this.alisId = alisId;
public Long getId() {
return id;
}
public AllAcqExchange(final int alisId, final String donorInstitute, final String accNumbDonor) {
this.alisId = alisId;
this.donorInstitute = donorInstitute;
this.accNumbDonor = accNumbDonor;
public void setId(Long id) {
this.id = id;
}
@Id
@Column(name = "ALIS_Id", unique = true, nullable = false)
public long getAlisId() {
return this.alisId;
public long getVersion() {
return version;
}
public void setAlisId(final long alisId) {
this.alisId = alisId;
public void setVersion(long version) {
this.version = version;
}
@Column(name = "Donor_Institute", length = 8)
public Accession getAccession() {
return accession;
}
public void setAccession(Accession accession) {
this.accession = accession;
}
public String getDonorInstitute() {
return this.donorInstitute;
}
......@@ -70,7 +91,6 @@ public class AllAcqExchange implements java.io.Serializable {
this.donorInstitute = donorInstitute;
}
@Column(name = "Acc_Numb_Donor", length = 36)
public String getAccNumbDonor() {
return this.accNumbDonor;
}
......
......@@ -20,92 +20,177 @@ package org.genesys2.server.model.genesys;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.MapsId;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Version;
@Entity
@Table(name = "environment")
public class AllEnvironment implements java.io.Serializable {
public class AllEnvironment {
/**
*
*/
private static final long serialVersionUID = -6266297665936383829L;
private Long alisId;
@Id
@Column(name = "ALIS_Id")
private Long id;
@Version
private long version = 0;
@MapsId
@OneToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumn(name = "ALIS_Id", unique = true, nullable = false, updatable = false)
private Accession accession;
@Column(name = "T_Min_Jan")
private Float TMinJan;
@Column(name = "T_Min_Feb")
private Float TMinFeb;
@Column(name = "T_Min_Mar")
private Float TMinMar;
@Column(name = "T_Min_Apr")
private Float TMinApr;
@Column(name = "T_Min_May")
private Float TMinMay;
@Column(name = "T_Min_Jun")
private Float TMinJun;
@Column(name = "T_Min_Jul")
private Float TMinJul;
@Column(name = "T_Min_Aug")
private Float TMinAug;
@Column(name = "T_Min_Sep")
private Float TMinSep;
@Column(name = "T_Min_Oct")
private Float TMinOct;
@Column(name = "T_Min_Nov")
private Float TMinNov;
@Column(name = "T_Min_Dec")
private Float TMinDec;
@Column(name = "T_Max_Jan")
private Float TMaxJan;
@Column(name = "T_Max_Feb")
private Float TMaxFeb;
@Column(name = "T_Max_Mar")
private Float TMaxMar;
@Column(name = "T_Max_Apr")
private Float TMaxApr;
@Column(name = "T_Max_May")
private Float TMaxMay;
@Column(name = "T_Max_Jun")
private Float TMaxJun;
@Column(name = "T_Max_Jul")
private Float TMaxJul;
@Column(name = "T_Max_Aug")
private Float TMaxAug;
@Column(name = "T_Max_Sep")
private Float TMaxSep;
@Column(name = "T_Max_Oct")
private Float TMaxOct;
@Column(name = "T_Max_Nov")
private Float TMaxNov;
@Column(name = "T_Max_Dec")
private Float TMaxDec;
@Column(name = "P_Jan")
private Float PJan;
@Column(name = "P_Feb")
private Float PFeb;
@Column(name = "P_Mar")
private Float PMar;
@Column(name = "P_Apr")
private Float PApr;
@Column(name = "P_May")
private Float PMay;
@Column(name = "P_Jun")
private Float PJun;
@Column(name = "P_Jul")
private Float PJul;
@Column(name = "P_Aug")
private Float PAug;
@Column(name = "P_Sep")
private Float PSep;
@Column(name = "P_Oct")
private Float POct;
@Column(name = "P_Nov")
private Float PNov;
@Column(name = "P_Dec")
private Float PDec;
@Column(name = "T_Min_Annual")
private Float TMinAnnual;
@Column(name = "T_Max_Annual")
private Float TMaxAnnual;
@Column(name = "P_Max_Annual")
private Float PMaxAnnual;
@Column(name = "Bio_1")
private Float bio1;
@Column(name = "Bio_2")
private Float bio2;
@Column(name = "Bio_3")
private Float bio3;
@Column(name = "Bio_4")
private Float bio4;
@Column(name = "Bio_5")
private Float bio5;
@Column(name = "Bio_6")
private Float bio6;
@Column(name = "Bio_7")
private Float bio7;
@Column(name = "Bio_8")
private Float bio8;