Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
14.0.4.Final
Description
In Keycloak, we want to use following query with projection of id field:
SELECT id FROM kc.HotRodUserSessionEntity c WHERE ((c.realmId = :realmId0) AND (c.offline = :offline0) AND (c.authenticatedClientSessions.clientId = :authenticatedClientSessionsclientId0)) ORDER BY lastSessionRefresh ASC
Id field is not indexed thus there is no projectable = true on the field. Rest of the fields used in the query are indexed.
// HotRodUserSessionEntity @ProtoField(number = 2) public String id; @Basic(sortable = true) @ProtoField(number = 3) public String realmId; @Basic(sortable = true) @ProtoField(number = 17) public Boolean offline; @Basic(sortable = true) @ProtoField(number = 16) public Set<HotRodAuthenticatedClientSessionEntityReference> authenticatedClientSessions; -- end of HotRodUserSessionEntity -- // HotRodAuthenticatedClientSessionEntityReference @Basic(sortable = true) @ProtoField(number = 1) public String clientId;
The query fails with the following error: ISPN028502: Unknown alias: authenticatedClientSessions.
This seems like a bug to us. It should be possible to project a field even if there is no index on it. We discussed something similar here https://issues.redhat.com/browse/ISPN-8584