fix several bugs in findSingleAttibute (#980)

* add test case for distinct on id property

* suggested fix for "select distinct id"

* add test case for distinct with fetch

* FIX: .setDistinct(true) can be used in conjunction with fetch() now

* add test case for distinct with beans that have a disriminator column

* FIX: discriminator column is only read if also Id is read.

* fine tuned the test case

* added test cases for findSingleAttributeList without distinct

* improved fix to support also findSingleAttribute without distinct

* ADD: Bonus test case - assertion not yet verified
This commit is contained in:
Roland Praml
2017-02-26 12:37:36 +13:00
committed by Rob Bygrave
parent 40ca179509
commit a46e086dc4
6 changed files with 171 additions and 13 deletions
@@ -15,7 +15,7 @@ final class SqlTreeNodeManyRoot extends SqlTreeNodeBean {
SqlTreeNodeManyRoot(String prefix, BeanPropertyAssocMany<?> prop, SqlTreeProperties props, List<SqlTreeNode> myList,
SpiQuery.TemporalMode temporalMode, boolean disableLazyLoad) {
super(prefix, prop, props, myList, temporalMode, disableLazyLoad);
super(prefix, prop, props, myList, true, temporalMode, disableLazyLoad);
this.manyProp = prop;
}