Commit a68834f5 by Yiming Liu

Add Mapping Entity

parent 06e51680
......@@ -3,7 +3,10 @@ package com.ctrip.apollo.biz.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import org.hibernate.annotations.SQLDelete;
@Entity
@SQLDelete(sql = "Update App set isDeleted = 1 where id = ?")
public class App extends BaseEntity {
@Column(nullable = false)
......
......@@ -6,11 +6,9 @@ import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
@Where(clause = "isDeleted = 0")
@SQLDelete(sql = "Update Cluster set isDeleted = 1 where id = ?")
public abstract class BaseEntity {
@Id
......
......@@ -3,10 +3,13 @@ package com.ctrip.apollo.biz.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import org.hibernate.annotations.SQLDelete;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@Entity
@SQLDelete(sql = "Update Cluster set isDeleted = 1 where id = ?")
public class Cluster extends BaseEntity {
@Column(nullable = false)
......
......@@ -3,7 +3,10 @@ package com.ctrip.apollo.biz.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import org.hibernate.annotations.SQLDelete;
@Entity
@SQLDelete(sql = "Update Group set isDeleted = 1 where id = ?")
public class Group extends BaseEntity {
@Column(nullable = false)
......
......@@ -3,7 +3,10 @@ package com.ctrip.apollo.biz.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import org.hibernate.annotations.SQLDelete;
@Entity
@SQLDelete(sql = "Update Item set isDeleted = 1 where id = ?")
public class Item extends BaseEntity {
@Column(nullable = false)
......
package com.ctrip.apollo.biz.entity;
import javax.persistence.Entity;
import org.hibernate.annotations.SQLDelete;
@Entity
@SQLDelete(sql = "Update Mapping set isDeleted = 1 where id = ?")
public class Mapping extends BaseEntity {
private long versionId;
private long releaseId;
public long getReleaseId() {
return releaseId;
}
public long getVersionId() {
return versionId;
}
public void setReleaseId(long releaseId) {
this.releaseId = releaseId;
}
public void setVersionId(long versionId) {
this.versionId = versionId;
}
}
......@@ -3,7 +3,10 @@ package com.ctrip.apollo.biz.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import org.hibernate.annotations.SQLDelete;
@Entity
@SQLDelete(sql = "Update Namespace set isDeleted = 1 where id = ?")
public class Namespace extends BaseEntity{
@Column(nullable = false)
......
......@@ -7,10 +7,13 @@ import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import org.hibernate.annotations.SQLDelete;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@Entity
@SQLDelete(sql = "Update Release set isDeleted = 1 where id = ?")
public class Release extends BaseEntity{
@Column(nullable = false)
......
......@@ -6,10 +6,13 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import org.hibernate.annotations.SQLDelete;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@Entity
@SQLDelete(sql = "Update Version set isDeleted = 1 where id = ?")
public class Version extends BaseEntity {
@Column(nullable = false)
......@@ -20,7 +23,7 @@ public class Version extends BaseEntity {
// parent version could be null
@Column
private Long parentVersion;
private Long parentVersionId;
@ManyToMany
private List<Release> releases;
......@@ -33,8 +36,8 @@ public class Version extends BaseEntity {
return name;
}
public Long getParentVersion() {
return parentVersion;
public Long getParentVersionId() {
return parentVersionId;
}
public List<Release> getReleases() {
......@@ -50,8 +53,8 @@ public class Version extends BaseEntity {
this.name = name;
}
public void setParentVersion(Long parentVersion) {
this.parentVersion = parentVersion;
public void setParentVersionId(Long parentVersionId) {
this.parentVersionId = parentVersionId;
}
public void setReleases(List<Release> releases) {
......
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