Commit 0b04bf65 authored by Matija Obreza's avatar Matija Obreza
Browse files

Added Accession#version (@Version) and #uuid fields

parent 66b6de37
ALTER TABLE `accession` ADD COLUMN `version` BIGINT NOT NULL DEFAULT 0 AFTER `id` ,
ADD COLUMN `uuid` VARCHAR(36) NULL DEFAULT NULL AFTER `Institute` ;
......@@ -30,6 +30,7 @@ import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;
import org.genesys2.server.lucene.genesys.AccessionBridge;
import org.genesys2.server.model.impl.Country;
......@@ -46,6 +47,8 @@ import org.hibernate.search.annotations.Indexed;
public class Accession implements java.io.Serializable {
private static final long serialVersionUID = -7630113633534038876L;
private Long id;
private long version = 0;
private String uuid;
private String instituteCode;
private FaoInstitute institute;
private String accNumbHi;
......@@ -85,6 +88,24 @@ public class Accession implements java.io.Serializable {
this.id = alisId;
}
@Version
public long getVersion() {
return version;
}
public void setVersion(long version) {
this.version = version;
}
@Column(length = 36)
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
@ManyToOne(cascade = {}, optional = true)
@JoinColumn(name = "instituteId")
public FaoInstitute getInstitute() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment