Commit 8ea9fa8e by Yiming Liu

Add explict column name for entity

parent 3f7016ef
......@@ -2,25 +2,27 @@ package com.ctrip.apollo.biz.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
@Entity
@Table(name = "App")
@SQLDelete(sql = "Update App set isDeleted = 1 where id = ?")
@Where(clause = "isDeleted = 0")
public class App extends BaseEntity {
@Column(nullable = false)
@Column(name = "Name", nullable = false)
private String name;
@Column(nullable = false)
@Column(name = "AppId", nullable = false)
private String appId;
@Column(nullable = false)
@Column(name = "OwnerName", nullable = false)
private String ownerName;
@Column(nullable = false)
@Column(name = "OnwerEmail", nullable = false)
private String ownerEmail;
public String getAppId() {
......
......@@ -2,22 +2,24 @@ package com.ctrip.apollo.biz.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
@Entity
@Table(name = "AppNamespace")
@SQLDelete(sql = "Update AppNamespace set isDeleted = 1 where id = ?")
@Where(clause = "isDeleted = 0")
public class AppNamespace extends BaseEntity{
public class AppNamespace extends BaseEntity {
@Column(nullable = false)
@Column(name = "Name", nullable = false)
private String name;
@Column(nullable = false)
@Column(name = "AppId", nullable = false)
private String appId;
@Column
@Column(name = "Comment")
private String comment;
public String getAppId() {
......
......@@ -18,9 +18,10 @@ public abstract class BaseEntity {
@Id
@GeneratedValue
@Column(name = "Id")
private long id;
@Column(name = "IsDeleted", columnDefinition="Bit default '0'")
@Column(name = "IsDeleted", columnDefinition = "Bit default '0'")
protected boolean isDeleted = false;
@Column(name = "DataChange_CreatedBy")
......
......@@ -2,6 +2,7 @@ package com.ctrip.apollo.biz.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
......@@ -10,14 +11,15 @@ import org.hibernate.annotations.Where;
* @author Jason Song(song_s@ctrip.com)
*/
@Entity
@Table(name = "Cluster")
@SQLDelete(sql = "Update Cluster set isDeleted = 1 where id = ?")
@Where(clause = "isDeleted = 0")
public class Cluster extends BaseEntity {
@Column(nullable = false)
@Column(name = "Name", nullable = false)
private String name;
@Column(nullable = false)
@Column(name = "AppId", nullable = false)
private String appId;
public String getAppId() {
......
......@@ -2,28 +2,30 @@ package com.ctrip.apollo.biz.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
@Entity
@Table(name = "Item")
@SQLDelete(sql = "Update Item set isDeleted = 1 where id = ?")
@Where(clause = "isDeleted = 0")
public class Item extends BaseEntity {
@Column(nullable = false)
@Column(name = "NamespaceId", nullable = false)
private long namespaceId;
@Column(nullable = false)
@Column(name = "key", nullable = false)
private String key;
@Column
@Column(name = "value")
private String value;
@Column
@Column(name = "comment")
private String comment;
@Column
@Column(name = "LineNum")
private Integer lineNum;
public String getComment() {
......
......@@ -2,22 +2,24 @@ package com.ctrip.apollo.biz.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
@Entity
@Table(name = "Namespace")
@SQLDelete(sql = "Update Namespace set isDeleted = 1 where id = ?")
@Where(clause = "isDeleted = 0")
public class Namespace extends BaseEntity {
@Column(nullable = false)
@Column(name = "appId", nullable = false)
private String appId;
@Column(nullable = false)
@Column(name = "ClusterName", nullable = false)
private String clusterName;
@Column(nullable = false)
@Column(name = "NamespaceName", nullable = false)
private String namespaceName;
public String getAppId() {
......
......@@ -2,22 +2,24 @@ package com.ctrip.apollo.biz.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
@Entity
@Table(name = "Privilege")
@SQLDelete(sql = "Update Privilege set isDeleted = 1 where id = ?")
@Where(clause = "isDeleted = 0")
public class Privilege extends BaseEntity {
@Column
@Column(name = "Name", nullable = false)
private String name;
@Column
@Column(name = "PrivilType", nullable = false)
private String privilType;
@Column
@Column(name = "NamespaceId")
private long namespaceId;
public String getName() {
......
......@@ -6,32 +6,34 @@ import org.hibernate.annotations.Where;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;
/**
* @author Jason Song(song_s@ctrip.com)
*/
@Entity
@Table(name = "Release")
@SQLDelete(sql = "Update Release set isDeleted = 1 where id = ?")
@Where(clause = "isDeleted = 0")
public class Release extends BaseEntity {
@Column(nullable = false)
@Column(name = "Name", nullable = false)
private String name;
@Column(nullable = false)
@Column(name = "AppId", nullable = false)
private String appId;
@Column(nullable = false)
@Column(name = "ClusterName", nullable = false)
private String clusterName;
@Column
@Column(name = "NamespaceName", nullable = false)
private String namespaceName;
@Column(nullable = false)
@Column(name = "Configurations", nullable = false)
@Lob
private String configurations;
@Column(nullable = false)
@Column(name = "Comment", nullable = false)
private String comment;
public String getAppId() {
......
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