Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
8ea9fa8e
Commit
8ea9fa8e
authored
Apr 15, 2016
by
Yiming Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add explict column name for entity
parent
3f7016ef
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
28 deletions
+43
-28
App.java
...lo-biz/src/main/java/com/ctrip/apollo/biz/entity/App.java
+6
-4
AppNamespace.java
...c/main/java/com/ctrip/apollo/biz/entity/AppNamespace.java
+6
-4
BaseEntity.java
...src/main/java/com/ctrip/apollo/biz/entity/BaseEntity.java
+2
-1
Cluster.java
...iz/src/main/java/com/ctrip/apollo/biz/entity/Cluster.java
+4
-2
Item.java
...o-biz/src/main/java/com/ctrip/apollo/biz/entity/Item.java
+7
-5
Namespace.java
.../src/main/java/com/ctrip/apollo/biz/entity/Namespace.java
+5
-3
Privilege.java
.../src/main/java/com/ctrip/apollo/biz/entity/Privilege.java
+5
-3
Release.java
...iz/src/main/java/com/ctrip/apollo/biz/entity/Release.java
+8
-6
No files found.
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/App.java
View file @
8ea9fa8e
...
...
@@ -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
(
n
ame
=
"Name"
,
n
ullable
=
false
)
private
String
name
;
@Column
(
nullable
=
false
)
@Column
(
n
ame
=
"AppId"
,
n
ullable
=
false
)
private
String
appId
;
@Column
(
nullable
=
false
)
@Column
(
n
ame
=
"OwnerName"
,
n
ullable
=
false
)
private
String
ownerName
;
@Column
(
nullable
=
false
)
@Column
(
n
ame
=
"OnwerEmail"
,
n
ullable
=
false
)
private
String
ownerEmail
;
public
String
getAppId
()
{
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/AppNamespace.java
View file @
8ea9fa8e
...
...
@@ -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
(
n
ame
=
"Name"
,
n
ullable
=
false
)
private
String
name
;
@Column
(
nullable
=
false
)
@Column
(
n
ame
=
"AppId"
,
n
ullable
=
false
)
private
String
appId
;
@Column
@Column
(
name
=
"Comment"
)
private
String
comment
;
public
String
getAppId
()
{
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/BaseEntity.java
View file @
8ea9fa8e
...
...
@@ -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"
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Cluster.java
View file @
8ea9fa8e
...
...
@@ -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
(
n
ame
=
"Name"
,
n
ullable
=
false
)
private
String
name
;
@Column
(
nullable
=
false
)
@Column
(
n
ame
=
"AppId"
,
n
ullable
=
false
)
private
String
appId
;
public
String
getAppId
()
{
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Item.java
View file @
8ea9fa8e
...
...
@@ -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
(
n
ame
=
"NamespaceId"
,
n
ullable
=
false
)
private
long
namespaceId
;
@Column
(
nullable
=
false
)
@Column
(
n
ame
=
"key"
,
n
ullable
=
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
()
{
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Namespace.java
View file @
8ea9fa8e
...
...
@@ -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
(
n
ame
=
"appId"
,
n
ullable
=
false
)
private
String
appId
;
@Column
(
nullable
=
false
)
@Column
(
n
ame
=
"ClusterName"
,
n
ullable
=
false
)
private
String
clusterName
;
@Column
(
nullable
=
false
)
@Column
(
n
ame
=
"NamespaceName"
,
n
ullable
=
false
)
private
String
namespaceName
;
public
String
getAppId
()
{
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Privilege.java
View file @
8ea9fa8e
...
...
@@ -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
()
{
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Release.java
View file @
8ea9fa8e
...
...
@@ -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
(
n
ame
=
"Name"
,
n
ullable
=
false
)
private
String
name
;
@Column
(
nullable
=
false
)
@Column
(
n
ame
=
"AppId"
,
n
ullable
=
false
)
private
String
appId
;
@Column
(
nullable
=
false
)
@Column
(
n
ame
=
"ClusterName"
,
n
ullable
=
false
)
private
String
clusterName
;
@Column
@Column
(
name
=
"NamespaceName"
,
nullable
=
false
)
private
String
namespaceName
;
@Column
(
nullable
=
false
)
@Column
(
n
ame
=
"Configurations"
,
n
ullable
=
false
)
@Lob
private
String
configurations
;
@Column
(
nullable
=
false
)
@Column
(
n
ame
=
"Comment"
,
n
ullable
=
false
)
private
String
comment
;
public
String
getAppId
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment