mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1060 - findSingleAttributeList doesn't store result in L2 query cache
This commit is contained in:
@@ -47,6 +47,43 @@ public class TestQueryCache extends BaseTestCase {
|
||||
assertThat(list2.get(0).getColumnB()).isEqualTo("10");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void findSingleAttribute() {
|
||||
|
||||
new EColAB("03", "SingleAttribute").save();
|
||||
new EColAB("03", "SingleAttribute").save();
|
||||
|
||||
List<String> colA_first = Ebean.getServer(null)
|
||||
.find(EColAB.class)
|
||||
.setUseQueryCache(true)
|
||||
.setDistinct(true)
|
||||
.select("columnA")
|
||||
.where()
|
||||
.eq("columnB", "SingleAttribute")
|
||||
.findSingleAttributeList();
|
||||
|
||||
List<String> colA_Second = Ebean.getServer(null)
|
||||
.find(EColAB.class)
|
||||
.setUseQueryCache(true)
|
||||
.setDistinct(true)
|
||||
.select("columnA")
|
||||
.where()
|
||||
.eq("columnB", "SingleAttribute")
|
||||
.findSingleAttributeList();
|
||||
|
||||
assertThat(colA_Second).isSameAs(colA_first);
|
||||
|
||||
List<String> colA_NotDistinct = Ebean.getServer(null)
|
||||
.find(EColAB.class)
|
||||
.setUseQueryCache(true)
|
||||
.select("columnA")
|
||||
.where()
|
||||
.eq("columnB", "SingleAttribute")
|
||||
.findSingleAttributeList();
|
||||
|
||||
assertThat(colA_Second).isNotSameAs(colA_NotDistinct);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void test() {
|
||||
|
||||
Reference in New Issue
Block a user