Given an aggregate
class StreamableAggregate implements Streamable<Object> { }
And a repository method
interface StreamableAggregateRepository extends Repository<StreamableAggregate, Object> {
StreamableAggregate findBy();
}
the findBy() method will be considered a collection query as QueryMethod.isCollectionQuery() unwraps all types implementing Streamable directly. We need to put guards in place that particularly rule out types assignable to the root domain type.