Ejemplo n.º 1
0
 @Test
 public void testAvgFunction() {
   Entity from = from(Entity.class);
   Query<Integer> select = select(avg(from.getIntegerField()));
   assertEquals("select avg(entity_0.integerField) from Entity entity_0", select.getQuery());
 }
Ejemplo n.º 2
0
 @Test
 public void testCustomFunctionWithFunction() {
   Entity from = from(Entity.class);
   Query<String> select = select(function("toto", String.class, max(from.getIntegerField())));
   assertEquals("select toto(max(entity_0.integerField)) from Entity entity_0", select.getQuery());
 }