diff --git a/CHANGES.md b/CHANGES.md index 233e862bba4..7a947731ec0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ Apollo 2.2.0 * [Fix OIDC logout unnecessary redirect](https://github.com/apolloconfig/apollo/pull/4773) * [[Multi-Database Support] Introduce h2 postgre profile properties to let user config database config](https://github.com/apolloconfig/apollo/pull/4766) * [[Multi-Database Support] Optimize column define case sensitivity](https://github.com/apolloconfig/apollo/pull/4776) +* [[Multi-Database Support][pg] Where clause need escape, otherwise will request postgre use lowwer case](https://github.com/apolloconfig/apollo/pull/4780) ------------------ All issues and pull requests are [here](https://github.com/apolloconfig/apollo/milestone/13?closed=1) \ No newline at end of file diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/AccessKey.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/AccessKey.java index fc4cc18c2a6..346cbdd3f14 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/AccessKey.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/AccessKey.java @@ -27,7 +27,7 @@ @Entity @Table(name = "`AccessKey`") @SQLDelete(sql = "Update AccessKey set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class AccessKey extends BaseEntity { @Column(name = "`AppId`", nullable = false) diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Audit.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Audit.java index a1311ed8d88..fa851bf11d4 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Audit.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Audit.java @@ -28,7 +28,7 @@ @Entity @Table(name = "`Audit`") @SQLDelete(sql = "Update Audit set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class Audit extends BaseEntity { public enum OP { diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Cluster.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Cluster.java index b1ad5500f69..d632fbc57ec 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Cluster.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Cluster.java @@ -31,7 +31,7 @@ @Entity @Table(name = "`Cluster`") @SQLDelete(sql = "Update Cluster set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class Cluster extends BaseEntity implements Comparable { @Column(name = "`Name`", nullable = false) diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Commit.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Commit.java index dee8866028c..96430e6bdbb 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Commit.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Commit.java @@ -29,7 +29,7 @@ @Entity @Table(name = "`Commit`") @SQLDelete(sql = "Update Commit set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class Commit extends BaseEntity { @Lob diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/GrayReleaseRule.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/GrayReleaseRule.java index 2865c085b32..9311f0363f2 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/GrayReleaseRule.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/GrayReleaseRule.java @@ -28,7 +28,7 @@ @Entity @Table(name = "`GrayReleaseRule`") @SQLDelete(sql = "Update GrayReleaseRule set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class GrayReleaseRule extends BaseEntity{ @Column(name = "`AppId`", nullable = false) diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Item.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Item.java index 17f3194a540..2c6752cdc58 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Item.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Item.java @@ -29,7 +29,7 @@ @Entity @Table(name = "`Item`") @SQLDelete(sql = "Update Item set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class Item extends BaseEntity { @Column(name = "`NamespaceId`", nullable = false) diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Namespace.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Namespace.java index 7ca70aaec69..b365eb91c66 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Namespace.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Namespace.java @@ -28,7 +28,7 @@ @Entity @Table(name = "`Namespace`") @SQLDelete(sql = "Update Namespace set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class Namespace extends BaseEntity { @Column(name = "`AppId`", nullable = false) diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/NamespaceLock.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/NamespaceLock.java index 1fe1512ce9b..9c1312451b0 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/NamespaceLock.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/NamespaceLock.java @@ -26,7 +26,7 @@ @Entity @Table(name = "`NamespaceLock`") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class NamespaceLock extends BaseEntity{ @Column(name = "`NamespaceId`") diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Privilege.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Privilege.java index 8d0a368533d..d1f346844f4 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Privilege.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Privilege.java @@ -28,7 +28,7 @@ @Entity @Table(name = "`Privilege`") @SQLDelete(sql = "Update Privilege set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class Privilege extends BaseEntity { @Column(name = "`Name`", nullable = false) diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Release.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Release.java index b415e4cccb2..e7d65743a3c 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Release.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Release.java @@ -32,7 +32,7 @@ @Entity @Table(name = "`Release`") @SQLDelete(sql = "Update Release set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class Release extends BaseEntity { @Column(name = "`ReleaseKey`", nullable = false) private String releaseKey; diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/ReleaseHistory.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/ReleaseHistory.java index a7d1568b300..9aa594d8741 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/ReleaseHistory.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/ReleaseHistory.java @@ -31,7 +31,7 @@ @Entity @Table(name = "`ReleaseHistory`") @SQLDelete(sql = "Update ReleaseHistory set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class ReleaseHistory extends BaseEntity { @Column(name = "`AppId`", nullable = false) private String appId; diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/ServerConfig.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/ServerConfig.java index 353e3cd9840..0d188d0667d 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/ServerConfig.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/ServerConfig.java @@ -31,7 +31,7 @@ @Entity @Table(name = "`ServerConfig`") @SQLDelete(sql = "Update ServerConfig set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class ServerConfig extends BaseEntity { @Column(name = "`Key`", nullable = false) private String key; diff --git a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/App.java b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/App.java index b0a3d7b81d5..0509c647a16 100644 --- a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/App.java +++ b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/App.java @@ -29,7 +29,7 @@ @Entity @Table(name = "`App`") @SQLDelete(sql = "Update App set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class App extends BaseEntity { @NotBlank(message = "Name cannot be blank") diff --git a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/AppNamespace.java b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/AppNamespace.java index 6ba559fd6f7..4c2c9cdb68f 100644 --- a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/AppNamespace.java +++ b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/entity/AppNamespace.java @@ -32,7 +32,7 @@ @Entity @Table(name = "`AppNamespace`") @SQLDelete(sql = "Update AppNamespace set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class AppNamespace extends BaseEntity { @NotBlank(message = "AppNamespace Name cannot be blank") diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/Consumer.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/Consumer.java index 3622cb1ff7b..fd24d750373 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/Consumer.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/Consumer.java @@ -28,7 +28,7 @@ @Entity @Table(name = "`Consumer`") @SQLDelete(sql = "Update Consumer set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class Consumer extends BaseEntity { @Column(name = "`Name`", nullable = false) diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/ConsumerRole.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/ConsumerRole.java index c68bf023cf5..6c5f9b7e32c 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/ConsumerRole.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/ConsumerRole.java @@ -31,7 +31,7 @@ @Entity @Table(name = "`ConsumerRole`") @SQLDelete(sql = "Update ConsumerRole set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class ConsumerRole extends BaseEntity { @Column(name = "`ConsumerId`", nullable = false) private long consumerId; diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/ConsumerToken.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/ConsumerToken.java index c6eb9c82832..0d36a09ceff 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/ConsumerToken.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/entity/ConsumerToken.java @@ -33,7 +33,7 @@ @Entity @Table(name = "`ConsumerToken`") @SQLDelete(sql = "Update ConsumerToken set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class ConsumerToken extends BaseEntity { @Column(name = "`ConsumerId`", nullable = false) private long consumerId; diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/Favorite.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/Favorite.java index e7a5cdbce4e..f9471d96328 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/Favorite.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/Favorite.java @@ -28,7 +28,7 @@ @Entity @Table(name = "`Favorite`") @SQLDelete(sql = "Update Favorite set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class Favorite extends BaseEntity { @Column(name = "`AppId`", nullable = false) diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/Permission.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/Permission.java index b7341ee6920..6c28d5323ba 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/Permission.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/Permission.java @@ -31,7 +31,7 @@ @Entity @Table(name = "`Permission`") @SQLDelete(sql = "Update Permission set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class Permission extends BaseEntity { @Column(name = "`PermissionType`", nullable = false) private String permissionType; diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/Role.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/Role.java index 61927bde35c..6c2bb2cd687 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/Role.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/Role.java @@ -31,7 +31,7 @@ @Entity @Table(name = "`Role`") @SQLDelete(sql = "Update Role set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class Role extends BaseEntity { @Column(name = "`RoleName`", nullable = false) private String roleName; diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/RolePermission.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/RolePermission.java index fb235d656f0..c624aa8011a 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/RolePermission.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/RolePermission.java @@ -31,7 +31,7 @@ @Entity @Table(name = "`RolePermission`") @SQLDelete(sql = "Update RolePermission set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class RolePermission extends BaseEntity { @Column(name = "`RoleId`", nullable = false) private long roleId; diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/ServerConfig.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/ServerConfig.java index db48eab6b9b..3363a2a9683 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/ServerConfig.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/ServerConfig.java @@ -32,7 +32,7 @@ @Entity @Table(name = "`ServerConfig`") @SQLDelete(sql = "Update ServerConfig set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class ServerConfig extends BaseEntity { @NotBlank(message = "ServerConfig.Key cannot be blank") @Column(name = "`Key`", nullable = false) diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/UserRole.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/UserRole.java index 8d43b3327bc..aa6ab8b28cb 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/UserRole.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/entity/po/UserRole.java @@ -31,7 +31,7 @@ @Entity @Table(name = "`UserRole`") @SQLDelete(sql = "Update UserRole set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000) where Id = ?") -@Where(clause = "IsDeleted = false") +@Where(clause = "`IsDeleted` = false") public class UserRole extends BaseEntity { @Column(name = "`UserId`", nullable = false) private String userId;