Hi,
I’m using an interface and polymorphic query like this:
public interface Taged {
String getTag();
}
@Entity
class Car implements Taged {
String tag
}
@Entity
class Plane implements Taged {
String tag
}
...
By these tags we can categorize any of our entities, for Example “fast” or “loud”.
I want to query any Taged Entity by a given tag with limit & offset (to support pagination) like this
select from Taged where tag = :t order by tag
This performs actually two selects: One in Car-Table and one in Plane-Table.
The problem is: The order of the two queries is not deterministic org.hibernate.query.hql.internal.QuerySpliter
and org.hibernate.query.sqm.tree.domain.SqmPolymorphicRootDescriptor
use Set<EntityDomainType<?>> getImplementors())
. This Set is not ordered, so each time i do my query, the order of DomainTypes may change
→ the Global result of my query is not deterministic and not usable for pagination
Suggestion:
IMHO it would be great, if the Set<EntityDomainType<?>> getImplementors()
would be sorted (e.g. by Entity-Name) to keep the order each time the query is invoked. By this pagination would be possible.