Commit 05ed035b by Yiming Liu

Update Entity

parent 6888ff73
package com.ctrip.apollo.biz.entity;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@Entity
@Where(clause = "isDeleted = 0")
@SQLDelete(sql = "Update ReleaseSnapShot set isDeleted = 1 where id = ?")
public class ReleaseSnapshot {
public class App extends BaseEntity{
@Id
@GeneratedValue
private long id;
@Column(nullable = false)
private long releaseId;
private String name;
@Column(nullable = false)
private String clusterName;
private String appId;
@Column(nullable = false)
private String configurations;
private String owner;
private boolean isDeleted;
public ReleaseSnapshot() {
public String getAppId() {
return appId;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getReleaseId() {
return releaseId;
public String getName() {
return name;
}
public void setReleaseId(long releaseId) {
this.releaseId = releaseId;
public String getOwner() {
return owner;
}
public String getClusterName() {
return clusterName;
public void setAppId(String appId) {
this.appId = appId;
}
public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
public String getConfigurations() {
return configurations;
}
public void setConfigurations(String configurations) {
this.configurations = configurations;
public void setId(long id) {
this.id = id;
}
public boolean isDeleted() {
return isDeleted;
public void setName(String name) {
this.name = name;
}
public void setDeleted(boolean deleted) {
isDeleted = deleted;
public void setOwner(String owner) {
this.owner = owner;
}
}
package com.ctrip.apollo.biz.entity;
import java.util.Date;
import javax.persistence.Column;
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 {
private boolean isDeleted;
@Column(name = "DataChange_CreatedBy")
private String dataChangeCreatedBy;
@Column(name = "DataChange_CreatedTime")
private Date dataChangeCreatedTime;
@Column(name = "DataChange_LastModifiedBy")
private String dataChangeLastModifiedBy;
@Column(name = "DataChange_LastTime")
private Date dataChangeLastModifiedTime;
public String getDataChangeCreatedBy() {
return dataChangeCreatedBy;
}
public Date getDataChangeCreatedTime() {
return dataChangeCreatedTime;
}
public String getDataChangeLastModifiedBy() {
return dataChangeLastModifiedBy;
}
public Date getDataChangeLastModifiedTime() {
return dataChangeLastModifiedTime;
}
public boolean isDeleted() {
return isDeleted;
}
public void setDataChangeCreatedBy(String dataChangeCreatedBy) {
this.dataChangeCreatedBy = dataChangeCreatedBy;
}
public void setDataChangeCreatedTime(Date dataChangeCreatedTime) {
this.dataChangeCreatedTime = dataChangeCreatedTime;
}
public void setDataChangeLastModifiedBy(String dataChangeLastModifiedBy) {
this.dataChangeLastModifiedBy = dataChangeLastModifiedBy;
}
public void setDataChangeLastModifiedTime(Date dataChangeLastModifiedTime) {
this.dataChangeLastModifiedTime = dataChangeLastModifiedTime;
}
public void setDeleted(boolean deleted) {
isDeleted = deleted;
}
}
package com.ctrip.apollo.biz.entity;
import com.ctrip.apollo.core.dto.ClusterDTO;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
......@@ -14,9 +9,8 @@ import javax.persistence.Id;
* @author Jason Song(song_s@ctrip.com)
*/
@Entity
@Where(clause = "isDeleted = 0")
@SQLDelete(sql = "Update Cluster set isDeleted = 1 where id = ?")
public class Cluster {
public class Cluster extends BaseEntity{
@Id
@GeneratedValue
private long id;
......@@ -27,8 +21,9 @@ public class Cluster {
@Column(nullable = false)
private String appId;
private boolean isDeleted;
@Column
private long clusterVersionId;
public Cluster() {
}
......@@ -56,19 +51,12 @@ public class Cluster {
this.appId = appId;
}
public boolean isDeleted() {
return isDeleted;
public long getClusterVersionId() {
return clusterVersionId;
}
public void setDeleted(boolean deleted) {
isDeleted = deleted;
public void setClusterVersionId(long clusterVersionId) {
this.clusterVersionId = clusterVersionId;
}
public ClusterDTO toDTO() {
ClusterDTO dto = new ClusterDTO();
dto.setAppId(appId);
dto.setId(id);
dto.setName(name);
return dto;
}
}
package com.ctrip.apollo.biz.entity;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
@Where(clause = "isDeleted = 0")
@SQLDelete(sql = "Update ConfigItem set isDeleted = 1 where id = ?")
public class ConfigItem {
public class ConfigItem extends BaseEntity {
@Id
@GeneratedValue
private long id;
@Column(nullable = false)
private long clusterId;
@Column(nullable = false)
private String clusterName;
@Column(nullable = false)
private String appId;
private long groupId;
@Column(nullable = false)
private String key;
......@@ -37,21 +24,6 @@ public class ConfigItem {
@Column
private String comment;
@Column(name = "DataChange_CreatedBy")
private String dataChangeCreatedBy;
@Column(name = "DataChange_CreatedTime")
private Date dataChangeCreatedTime;
@Column(name = "DataChange_LastModifiedBy")
private String dataChangeLastModifiedBy;
@Column(name = "DataChange_LastTime")
private Date dataChangeLastModifiedTime;
@Column
private boolean IsDeleted;
public long getId() {
return id;
}
......@@ -60,28 +32,12 @@ public class ConfigItem {
this.id = id;
}
public long getClusterId() {
return clusterId;
}
public void setClusterId(long clusterId) {
this.clusterId = clusterId;
}
public String getClusterName() {
return clusterName;
}
public void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
public String getAppId() {
return appId;
public long getGroupId() {
return groupId;
}
public void setAppId(String appId) {
this.appId = appId;
public void setGroupId(long groupId) {
this.groupId = groupId;
}
public String getKey() {
......@@ -108,44 +64,4 @@ public class ConfigItem {
this.comment = comment;
}
public String getDataChangeCreatedBy() {
return dataChangeCreatedBy;
}
public void setDataChangeCreatedBy(String dataChangeCreatedBy) {
this.dataChangeCreatedBy = dataChangeCreatedBy;
}
public Date getDataChangeCreatedTime() {
return dataChangeCreatedTime;
}
public void setDataChangeCreatedTime(Date dataChangeCreatedTime) {
this.dataChangeCreatedTime = dataChangeCreatedTime;
}
public String getDataChangeLastModifiedBy() {
return dataChangeLastModifiedBy;
}
public void setDataChangeLastModifiedBy(String dataChangeLastModifiedBy) {
this.dataChangeLastModifiedBy = dataChangeLastModifiedBy;
}
public boolean isDeleted() {
return IsDeleted;
}
public void setDeleted(boolean isDeleted) {
IsDeleted = isDeleted;
}
public Date getDataChangeLastModifiedTime() {
return dataChangeLastModifiedTime;
}
public void setDataChangeLastModifiedTime(Date dataChangeLastModifiedTime) {
this.dataChangeLastModifiedTime = dataChangeLastModifiedTime;
}
}
package com.ctrip.apollo.biz.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class Group extends BaseEntity{
@Id
@GeneratedValue
private long id;
@Column(nullable = false)
private long clusterId;
@Column(nullable = false)
private long namespaceId;
public long getClusterId() {
return clusterId;
}
public long getId() {
return id;
}
public long getNamespaceId() {
return namespaceId;
}
public void setClusterId(long clusterId) {
this.clusterId = clusterId;
}
public void setId(long id) {
this.id = id;
}
public void setNamespaceId(long namespaceId) {
this.namespaceId = namespaceId;
}
}
package com.ctrip.apollo.biz.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class Namespace extends BaseEntity{
@Id
@GeneratedValue
private long id;
@Column(nullable = false)
private String name;
@Column(nullable = false)
private String appId;
@Column
private String comment;
public String getAppId() {
return appId;
}
public String getComment() {
return comment;
}
public long getId() {
return id;
}
public String getName() {
return name;
}
public void setAppId(String appId) {
this.appId = appId;
}
public void setComment(String comment) {
this.comment = comment;
}
public void setId(long id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
}
package com.ctrip.apollo.biz.entity;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@Entity
@Where(clause = "isDeleted = 0")
@SQLDelete(sql = "Update Release set isDeleted = 1 where id = ?")
public class Release {
public class Release extends BaseEntity{
@Id
@GeneratedValue
private long id;
@Column(nullable = false)
private String name;
private String appId;
@Column(nullable = false)
private long groupId;
@Column(nullable = false)
@Lob
private String configurations;
@Column(nullable = false)
private String comment;
private boolean isDeleted;
public Release() {
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
public long getGroupId() {
return groupId;
}
public String getName() {
return name;
public String getComment() {
return comment;
}
public void setName(String name) {
this.name = name;
public String getConfigurations() {
return configurations;
}
public String getAppId() {
return appId;
public long getId() {
return id;
}
public void setAppId(String appId) {
this.appId = appId;
public String getName() {
return name;
}
public String getComment() {
return comment;
public void setGroupId(long groupId) {
this.groupId = groupId;
}
public void setComment(String comment) {
this.comment = comment;
}
public boolean isDeleted() {
return isDeleted;
public void setConfigurations(String configurations) {
this.configurations = configurations;
}
public void setDeleted(boolean deleted) {
isDeleted = deleted;
public void setId(long id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
}
package com.ctrip.apollo.biz.entity;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -12,9 +11,7 @@ import javax.persistence.Id;
* @author Jason Song(song_s@ctrip.com)
*/
@Entity
@Where(clause = "isDeleted = 0")
@SQLDelete(sql = "Update Version set isDeleted = 1 where id = ?")
public class Version {
public class Version extends BaseEntity {
@Id
@GeneratedValue
private long id;
......@@ -23,63 +20,54 @@ public class Version {
private String name;
@Column(nullable = false)
private String appId;
private String clusterId;
@Column(nullable = false)
private long releaseId;
//parent version could be null
// parent version could be null
@Column
private Long parentVersion;
private boolean isDeleted;
public Version() {
private List<Release> releases;
public Version() {}
public String getClusterId() {
return clusterId;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public long getReleaseId() {
return releaseId;
public Long getParentVersion() {
return parentVersion;
}
public void setReleaseId(long releaseId) {
this.releaseId = releaseId;
public List<Release> getReleases() {
return releases;
}
public boolean isDeleted() {
return isDeleted;
public void setClusterId(String clusterId) {
this.clusterId = clusterId;
}
public void setDeleted(boolean deleted) {
isDeleted = deleted;
public void setId(long id) {
this.id = id;
}
public Long getParentVersion() {
return parentVersion;
public void setName(String name) {
this.name = name;
}
public void setParentVersion(Long parentVersion) {
this.parentVersion = parentVersion;
}
public void setReleases(List<Release> releases) {
this.releases = 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