Example #1
0
  @Before
  public void setUp() {
    myInts.add(1);
    myInts.add(2);
    myInts.add(3);
    myInts.add(4);

    Alias.resetAlias();
  }
Example #2
0
  @Test
  public void WithSimpleClass() {
    List<CloneableKlasse> vos = new ArrayList<CloneableKlasse>();
    for (int i = 0; i < 5; i++) {
      CloneableKlasse vo = new CloneableKlasse();
      vo.setOtherValue(i);
      vos.add(vo);
    }
    CloneableKlasse vo = Alias.alias(CloneableKlasse.class, "vo");
    assertNotNull(vo);
    CollQuery<?> query = new CollQuery<Void>();
    final EntityPathBase<CloneableKlasse> fromVo = Alias.$(vo);
    assertNotNull(fromVo);
    query.from(fromVo, vos);
    query.where(Alias.$(vo.getOtherValue()).eq(1));
    List<CloneableKlasse> result = query.select(Alias.$(vo)).fetch();

    assertNotNull(result);
    assertEquals(1, result.size());
    assertEquals(Integer.valueOf(1), result.get(0).getOtherValue());
  }
Example #3
0
 /**
  * Convert the given alias to an expression
  *
  * @param arg alias
  * @param <D>
  * @return expression
  */
 public static <D extends Comparable<?>> ComparablePath<D> $(D arg) {
   return Alias.getPath(arg);
 }