From 701fb06de164e3df01cd7050e0b0e133a0205af8 Mon Sep 17 00:00:00 2001 From: vramik Date: Wed, 12 Feb 2020 15:01:16 +0100 Subject: [PATCH] KEYCLOAK-12968 fix ClientTest.getAllClientsSearchAndPagination for postgresql --- .../models/jpa/entities/ClientEntity.java | 6 ++--- .../META-INF/jpa-changelog-9.0.1.xml | 26 +++++++++++++++++++ .../META-INF/jpa-changelog-master.xml | 1 + 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 model/jpa/src/main/resources/META-INF/jpa-changelog-9.0.1.xml diff --git a/model/jpa/src/main/java/org/keycloak/models/jpa/entities/ClientEntity.java b/model/jpa/src/main/java/org/keycloak/models/jpa/entities/ClientEntity.java index 5e9823a3d2..5c54b75666 100755 --- a/model/jpa/src/main/java/org/keycloak/models/jpa/entities/ClientEntity.java +++ b/model/jpa/src/main/java/org/keycloak/models/jpa/entities/ClientEntity.java @@ -53,10 +53,10 @@ import java.util.Set; @NamedQueries({ @NamedQuery(name="getClientsByRealm", query="select client from ClientEntity client where client.realm = :realm"), @NamedQuery(name="getClientById", query="select client from ClientEntity client where client.id = :id and client.realm.id = :realm"), - @NamedQuery(name="getClientIdsByRealm", query="select client.id from ClientEntity client where client.realm.id = :realm"), - @NamedQuery(name="getAlwaysDisplayInConsoleClients", query="select client.id from ClientEntity client where client.alwaysDisplayInConsole = true and client.realm.id = :realm"), + @NamedQuery(name="getClientIdsByRealm", query="select client.id from ClientEntity client where client.realm.id = :realm order by client.clientId"), + @NamedQuery(name="getAlwaysDisplayInConsoleClients", query="select client.id from ClientEntity client where client.alwaysDisplayInConsole = true and client.realm.id = :realm order by client.clientId"), @NamedQuery(name="findClientIdByClientId", query="select client.id from ClientEntity client where client.clientId = :clientId and client.realm.id = :realm"), - @NamedQuery(name="searchClientsByClientId", query="select client.id from ClientEntity client where lower(client.clientId) like lower(concat('%',:clientId,'%')) and client.realm.id = :realm"), + @NamedQuery(name="searchClientsByClientId", query="select client.id from ClientEntity client where lower(client.clientId) like lower(concat('%',:clientId,'%')) and client.realm.id = :realm order by client.clientId"), @NamedQuery(name="getRealmClientsCount", query="select count(client) from ClientEntity client where client.realm.id = :realm"), @NamedQuery(name="findClientByClientId", query="select client from ClientEntity client where client.clientId = :clientId and client.realm.id = :realm"), }) diff --git a/model/jpa/src/main/resources/META-INF/jpa-changelog-9.0.1.xml b/model/jpa/src/main/resources/META-INF/jpa-changelog-9.0.1.xml new file mode 100644 index 0000000000..5fb8dd3bd0 --- /dev/null +++ b/model/jpa/src/main/resources/META-INF/jpa-changelog-9.0.1.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + diff --git a/model/jpa/src/main/resources/META-INF/jpa-changelog-master.xml b/model/jpa/src/main/resources/META-INF/jpa-changelog-master.xml index ae056eb232..1af1ea82af 100755 --- a/model/jpa/src/main/resources/META-INF/jpa-changelog-master.xml +++ b/model/jpa/src/main/resources/META-INF/jpa-changelog-master.xml @@ -65,4 +65,5 @@ +