コード例 #1
0
 @Test
 public void testCountDistinctWorkaround() {
   Entity fromOrder = from(Entity.class);
   Query<Long> select = select(function("count", Long.class, distinct(fromOrder.getInterface())));
   assertEquals(
       "select count(distinct entity_0.interface) from Entity entity_0", select.getQuery());
 }
コード例 #2
0
 @Test
 public void testCountDistinct() {
   Entity fromOrder = from(Entity.class);
   // throws an NPE
   Query<Long> select = select(count(distinct(fromOrder.getInterface())));
   assertEquals(
       "select count(distinct entity_0.interface) from Entity entity_0", select.getQuery());
 }
コード例 #3
0
 @Test
 public void testDistinctOnInterface() {
   Entity fromOrder = from(Entity.class);
   Query select = select(distinct(fromOrder.getInterface()));
   assertEquals("select distinct entity_0.interface from Entity entity_0", select.getQuery());
 }