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
05ed035b
Commit
05ed035b
authored
Apr 05, 2016
by
Yiming Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Entity
parent
6888ff73
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
260 additions
and
216 deletions
+260
-216
App.java
...lo-biz/src/main/java/com/ctrip/apollo/biz/entity/App.java
+19
-40
BaseEntity.java
...src/main/java/com/ctrip/apollo/biz/entity/BaseEntity.java
+67
-0
Cluster.java
...iz/src/main/java/com/ctrip/apollo/biz/entity/Cluster.java
+9
-21
ConfigItem.java
...src/main/java/com/ctrip/apollo/biz/entity/ConfigItem.java
+6
-90
Group.java
...-biz/src/main/java/com/ctrip/apollo/biz/entity/Group.java
+45
-0
Namespace.java
.../src/main/java/com/ctrip/apollo/biz/entity/Namespace.java
+56
-0
Release.java
...iz/src/main/java/com/ctrip/apollo/biz/entity/Release.java
+33
-28
Version.java
...iz/src/main/java/com/ctrip/apollo/biz/entity/Version.java
+25
-37
No files found.
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/
ReleaseSnapshot
.java
→
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/
App
.java
View file @
05ed035b
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
set
Deleted
(
boolean
deleted
)
{
isDeleted
=
deleted
;
public
void
set
Owner
(
String
owner
)
{
this
.
owner
=
owner
;
}
}
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/BaseEntity.java
0 → 100644
View file @
05ed035b
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
;
}
}
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Cluster.java
View file @
05ed035b
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
isDelete
d
()
{
return
isDelete
d
;
public
long
getClusterVersionI
d
()
{
return
clusterVersionI
d
;
}
public
void
set
Deleted
(
boolean
delete
d
)
{
isDeleted
=
delete
d
;
public
void
set
ClusterVersionId
(
long
clusterVersionI
d
)
{
this
.
clusterVersionId
=
clusterVersionI
d
;
}
public
ClusterDTO
toDTO
()
{
ClusterDTO
dto
=
new
ClusterDTO
();
dto
.
setAppId
(
appId
);
dto
.
setId
(
id
);
dto
.
setName
(
name
);
return
dto
;
}
}
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/ConfigItem.java
View file @
05ed035b
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
set
AppId
(
String
ap
pId
)
{
this
.
appId
=
ap
pId
;
public
void
set
GroupId
(
long
grou
pId
)
{
this
.
groupId
=
grou
pId
;
}
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
;
}
}
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Group.java
0 → 100644
View file @
05ed035b
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
;
}
}
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Namespace.java
0 → 100644
View file @
05ed035b
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
;
}
}
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Release.java
View file @
05ed035b
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
get
Name
()
{
return
name
;
public
String
get
Comment
()
{
return
comment
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
public
String
getConfigurations
(
)
{
return
configurations
;
}
public
String
getApp
Id
()
{
return
appI
d
;
public
long
get
Id
()
{
return
i
d
;
}
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
;
}
}
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Version.java
View file @
05ed035b
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
app
Id
;
private
String
cluster
Id
;
@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
isDelete
d
;
public
void
setClusterId
(
String
clusterId
)
{
this
.
clusterId
=
clusterI
d
;
}
public
void
set
Deleted
(
boolean
delete
d
)
{
isDeleted
=
delete
d
;
public
void
set
Id
(
long
i
d
)
{
this
.
id
=
i
d
;
}
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
;
}
}
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