use of com.querydsl.jpa.domain.QCat in project querydsl by querydsl.
the class JPAQueryMixinTest method orderBy_long.
@Test
public void orderBy_long() {
QCat cat = QCat.cat;
QCat catMate = new QCat("cat_mate");
QCat catMateMate = new QCat("cat_mate_mate");
mixin.from(cat);
mixin.orderBy(cat.mate.mate.name.asc());
QueryMetadata md = mixin.getMetadata();
assertEquals(Arrays.asList(new JoinExpression(JoinType.DEFAULT, cat), new JoinExpression(JoinType.LEFTJOIN, cat.mate.as(catMate)), new JoinExpression(JoinType.LEFTJOIN, catMate.mate.as(catMateMate))), md.getJoins());
assertEquals(Arrays.asList(catMateMate.name.asc()), md.getOrderBy());
}
use of com.querydsl.jpa.domain.QCat in project querydsl by querydsl.
the class JPAQueryMixinTest method orderBy_operation.
@Test
public void orderBy_operation() {
QCat cat = QCat.cat;
QCat catMate = new QCat("cat_mate");
mixin.from(cat);
mixin.orderBy(cat.mate.name.lower().asc());
QueryMetadata md = mixin.getMetadata();
assertEquals(Arrays.asList(new JoinExpression(JoinType.DEFAULT, cat), new JoinExpression(JoinType.LEFTJOIN, cat.mate.as(catMate))), md.getJoins());
assertEquals(Arrays.asList(catMate.name.lower().asc()), md.getOrderBy());
}
use of com.querydsl.jpa.domain.QCat in project querydsl by querydsl.
the class JPAQueryMixinTest method orderBy_nullsLast.
@Test
public void orderBy_nullsLast() {
QCat cat = QCat.cat;
mixin.from(cat);
mixin.orderBy(cat.mate.name.asc().nullsLast());
assertEquals(OrderSpecifier.NullHandling.NullsLast, mixin.getMetadata().getOrderBy().get(0).getNullHandling());
}
use of com.querydsl.jpa.domain.QCat in project querydsl by querydsl.
the class JPAQueryMixinTest method orderBy_reuse.
@Test
public void orderBy_reuse() {
QCat cat = QCat.cat;
QCat mate = new QCat("mate");
mixin.from(cat);
mixin.leftJoin(cat.mate, mate);
mixin.orderBy(cat.mate.name.asc());
QueryMetadata md = mixin.getMetadata();
assertEquals(Arrays.asList(new JoinExpression(JoinType.DEFAULT, cat), new JoinExpression(JoinType.LEFTJOIN, cat.mate.as(mate))), md.getJoins());
assertEquals(Arrays.asList(mate.name.asc()), md.getOrderBy());
}
use of com.querydsl.jpa.domain.QCat in project querydsl by querydsl.
the class JPAQueryMixinTest method orderBy_groupBy.
@Test
public void orderBy_groupBy() {
QCat cat = QCat.cat;
mixin.from(cat);
mixin.groupBy(cat.mate.name);
mixin.orderBy(cat.mate.name.asc());
QueryMetadata md = mixin.getMetadata();
assertEquals(Arrays.asList(new JoinExpression(JoinType.DEFAULT, cat)), md.getJoins());
assertEquals(Arrays.asList(cat.mate.name.asc()), md.getOrderBy());
}
Aggregations