Skip to content

Commit

Permalink
[Multi-Database Support][pg] Where clause need escape, otherwise will…
Browse files Browse the repository at this point in the history
… request postgre use lowwer case (#4780)

* [Multi-Database Support][pg] Where clause need escape, otherwise will request postgre use lowwer case

* add changes md
  • Loading branch information
shoothzj authored Mar 7, 2023
1 parent f03a85e commit ce1c2f8
Show file tree
Hide file tree
Showing 24 changed files with 24 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Cluster> {

@Column(name = "`Name`", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

@Entity
@Table(name = "`NamespaceLock`")
@Where(clause = "IsDeleted = false")
@Where(clause = "`IsDeleted` = false")
public class NamespaceLock extends BaseEntity{

@Column(name = "`NamespaceId`")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ce1c2f8

Please sign in to comment.