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
a68834f5
Commit
a68834f5
authored
Apr 06, 2016
by
Yiming Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Mapping Entity
parent
06e51680
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
57 additions
and
8 deletions
+57
-8
App.java
...lo-biz/src/main/java/com/ctrip/apollo/biz/entity/App.java
+3
-0
BaseEntity.java
...src/main/java/com/ctrip/apollo/biz/entity/BaseEntity.java
+0
-2
Cluster.java
...iz/src/main/java/com/ctrip/apollo/biz/entity/Cluster.java
+3
-0
Group.java
...-biz/src/main/java/com/ctrip/apollo/biz/entity/Group.java
+3
-0
Item.java
...o-biz/src/main/java/com/ctrip/apollo/biz/entity/Item.java
+4
-1
Mapping.java
...iz/src/main/java/com/ctrip/apollo/biz/entity/Mapping.java
+30
-0
Namespace.java
.../src/main/java/com/ctrip/apollo/biz/entity/Namespace.java
+3
-0
Release.java
...iz/src/main/java/com/ctrip/apollo/biz/entity/Release.java
+3
-0
Version.java
...iz/src/main/java/com/ctrip/apollo/biz/entity/Version.java
+8
-5
No files found.
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/App.java
View file @
a68834f5
...
@@ -3,7 +3,10 @@ package com.ctrip.apollo.biz.entity;
...
@@ -3,7 +3,10 @@ package com.ctrip.apollo.biz.entity;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
org.hibernate.annotations.SQLDelete
;
@Entity
@Entity
@SQLDelete
(
sql
=
"Update App set isDeleted = 1 where id = ?"
)
public
class
App
extends
BaseEntity
{
public
class
App
extends
BaseEntity
{
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/BaseEntity.java
View file @
a68834f5
...
@@ -6,11 +6,9 @@ import javax.persistence.Column;
...
@@ -6,11 +6,9 @@ import javax.persistence.Column;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
import
org.hibernate.annotations.SQLDelete
;
import
org.hibernate.annotations.Where
;
import
org.hibernate.annotations.Where
;
@Where
(
clause
=
"isDeleted = 0"
)
@Where
(
clause
=
"isDeleted = 0"
)
@SQLDelete
(
sql
=
"Update Cluster set isDeleted = 1 where id = ?"
)
public
abstract
class
BaseEntity
{
public
abstract
class
BaseEntity
{
@Id
@Id
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Cluster.java
View file @
a68834f5
...
@@ -3,10 +3,13 @@ package com.ctrip.apollo.biz.entity;
...
@@ -3,10 +3,13 @@ package com.ctrip.apollo.biz.entity;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
org.hibernate.annotations.SQLDelete
;
/**
/**
* @author Jason Song(song_s@ctrip.com)
* @author Jason Song(song_s@ctrip.com)
*/
*/
@Entity
@Entity
@SQLDelete
(
sql
=
"Update Cluster set isDeleted = 1 where id = ?"
)
public
class
Cluster
extends
BaseEntity
{
public
class
Cluster
extends
BaseEntity
{
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Group.java
View file @
a68834f5
...
@@ -3,7 +3,10 @@ package com.ctrip.apollo.biz.entity;
...
@@ -3,7 +3,10 @@ package com.ctrip.apollo.biz.entity;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
org.hibernate.annotations.SQLDelete
;
@Entity
@Entity
@SQLDelete
(
sql
=
"Update Group set isDeleted = 1 where id = ?"
)
public
class
Group
extends
BaseEntity
{
public
class
Group
extends
BaseEntity
{
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Item.java
View file @
a68834f5
...
@@ -3,8 +3,11 @@ package com.ctrip.apollo.biz.entity;
...
@@ -3,8 +3,11 @@ package com.ctrip.apollo.biz.entity;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
org.hibernate.annotations.SQLDelete
;
@Entity
@Entity
public
class
Item
extends
BaseEntity
{
@SQLDelete
(
sql
=
"Update Item set isDeleted = 1 where id = ?"
)
public
class
Item
extends
BaseEntity
{
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
private
long
groupId
;
private
long
groupId
;
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Mapping.java
0 → 100644
View file @
a68834f5
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
;
}
}
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Namespace.java
View file @
a68834f5
...
@@ -3,7 +3,10 @@ package com.ctrip.apollo.biz.entity;
...
@@ -3,7 +3,10 @@ package com.ctrip.apollo.biz.entity;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
org.hibernate.annotations.SQLDelete
;
@Entity
@Entity
@SQLDelete
(
sql
=
"Update Namespace set isDeleted = 1 where id = ?"
)
public
class
Namespace
extends
BaseEntity
{
public
class
Namespace
extends
BaseEntity
{
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Release.java
View file @
a68834f5
...
@@ -7,10 +7,13 @@ import javax.persistence.Entity;
...
@@ -7,10 +7,13 @@ import javax.persistence.Entity;
import
javax.persistence.Lob
;
import
javax.persistence.Lob
;
import
javax.persistence.ManyToMany
;
import
javax.persistence.ManyToMany
;
import
org.hibernate.annotations.SQLDelete
;
/**
/**
* @author Jason Song(song_s@ctrip.com)
* @author Jason Song(song_s@ctrip.com)
*/
*/
@Entity
@Entity
@SQLDelete
(
sql
=
"Update Release set isDeleted = 1 where id = ?"
)
public
class
Release
extends
BaseEntity
{
public
class
Release
extends
BaseEntity
{
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/Version.java
View file @
a68834f5
...
@@ -6,10 +6,13 @@ import javax.persistence.Column;
...
@@ -6,10 +6,13 @@ import javax.persistence.Column;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.ManyToMany
;
import
javax.persistence.ManyToMany
;
import
org.hibernate.annotations.SQLDelete
;
/**
/**
* @author Jason Song(song_s@ctrip.com)
* @author Jason Song(song_s@ctrip.com)
*/
*/
@Entity
@Entity
@SQLDelete
(
sql
=
"Update Version set isDeleted = 1 where id = ?"
)
public
class
Version
extends
BaseEntity
{
public
class
Version
extends
BaseEntity
{
@Column
(
nullable
=
false
)
@Column
(
nullable
=
false
)
...
@@ -20,7 +23,7 @@ public class Version extends BaseEntity {
...
@@ -20,7 +23,7 @@ public class Version extends BaseEntity {
// parent version could be null
// parent version could be null
@Column
@Column
private
Long
parentVersion
;
private
Long
parentVersion
Id
;
@ManyToMany
@ManyToMany
private
List
<
Release
>
releases
;
private
List
<
Release
>
releases
;
...
@@ -33,8 +36,8 @@ public class Version extends BaseEntity {
...
@@ -33,8 +36,8 @@ public class Version extends BaseEntity {
return
name
;
return
name
;
}
}
public
Long
getParentVersion
()
{
public
Long
getParentVersion
Id
()
{
return
parentVersion
;
return
parentVersion
Id
;
}
}
public
List
<
Release
>
getReleases
()
{
public
List
<
Release
>
getReleases
()
{
...
@@ -50,8 +53,8 @@ public class Version extends BaseEntity {
...
@@ -50,8 +53,8 @@ public class Version extends BaseEntity {
this
.
name
=
name
;
this
.
name
=
name
;
}
}
public
void
setParentVersion
(
Long
parentVersion
)
{
public
void
setParentVersion
Id
(
Long
parentVersionId
)
{
this
.
parentVersion
=
parentVersion
;
this
.
parentVersion
Id
=
parentVersionId
;
}
}
public
void
setReleases
(
List
<
Release
>
releases
)
{
public
void
setReleases
(
List
<
Release
>
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