#67: Relations database schema

This commit is contained in:
jendib 2016-03-03 23:54:48 +01:00
parent f927193ae9
commit 7e983bebb9
7 changed files with 93 additions and 5 deletions

View File

@ -13,7 +13,7 @@ import com.google.common.base.MoreObjects;
* @author bgamard * @author bgamard
*/ */
@Entity @Entity
@Table(name = "T_Contributor") @Table(name = "T_CONTRIBUTOR")
public class Contributor { public class Contributor {
/** /**
* Contributor ID. * Contributor ID.

View File

@ -0,0 +1,85 @@
package com.sismics.docs.core.model.jpa;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import com.google.common.base.MoreObjects;
/**
* Relation entity.
*
* @author bgamard
*/
@Entity
@Table(name = "T_RELATION")
public class Relation {
/**
* Relation ID.
*/
@Id
@Column(name = "REL_ID_C", length = 36)
private String id;
/**
* Source document ID.
*/
@Column(name = "REL_IDDOCFROM_C", length = 36, nullable = false)
private String fromDocumentId;
/**
* Destination document ID.
*/
@Column(name = "REL_IDDOCTO_C", length = 36, nullable = false)
private String toDocumentId;
/**
* Deletion date.
*/
@Column(name = "REL_DELETEDATE_D")
private Date deleteDate;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getFromDocumentId() {
return fromDocumentId;
}
public void setFromDocumentId(String fromDocumentId) {
this.fromDocumentId = fromDocumentId;
}
public String getToDocumentId() {
return toDocumentId;
}
public void setToDocumentId(String toDocumentId) {
this.toDocumentId = toDocumentId;
}
public Date getDeleteDate() {
return deleteDate;
}
public void setDeleteDate(Date deleteDate) {
this.deleteDate = deleteDate;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("id", id)
.add("fromDocumentId", fromDocumentId)
.add("toDocumentId", toDocumentId)
.toString();
}
}

View File

@ -1 +1 @@
db.version=6 db.version=7

View File

@ -0,0 +1,3 @@
create cached table T_RELATION ( REL_ID_C varchar(36) not null, REL_IDDOCFROM_C varchar(36) not null, REL_IDDOCTO_C varchar(36) not null, REL_DELETEDATE_D datetime, primary key (REL_ID_C) );
update T_CONFIG set CFG_VALUE_C = '7' where CFG_ID_C = 'DB_VERSION';

View File

@ -1,3 +1,3 @@
api.current_version=${project.version} api.current_version=${project.version}
api.min_version=1.0 api.min_version=1.0
db.version=6 db.version=7

View File

@ -1,3 +1,3 @@
api.current_version=${project.version} api.current_version=${project.version}
api.min_version=1.0 api.min_version=1.0
db.version=6 db.version=7

View File

@ -1,3 +1,3 @@
api.current_version=${project.version} api.current_version=${project.version}
api.min_version=1.0 api.min_version=1.0
db.version=6 db.version=7