use of com.querydsl.jpa.domain.QDepartment in project querydsl by querydsl.
the class JPAQueryMixinTest method orderBy_nonRoot_twice.
@Test
public void orderBy_nonRoot_twice() {
QDepartment department = QDepartment.department;
QCompany departmentCompany = new QCompany("department_company");
QEmployee departmentCompanyCeo = new QEmployee("department_company_ceo");
mixin.from(department);
mixin.orderBy(department.company.ceo.firstName.asc(), department.company.ceo.lastName.asc());
QueryMetadata md = mixin.getMetadata();
assertEquals(Arrays.asList(new JoinExpression(JoinType.DEFAULT, department), new JoinExpression(JoinType.LEFTJOIN, department.company.as(departmentCompany)), new JoinExpression(JoinType.LEFTJOIN, departmentCompany.ceo.as(departmentCompanyCeo))), md.getJoins());
assertEquals(Arrays.asList(departmentCompanyCeo.firstName.asc(), departmentCompanyCeo.lastName.asc()), md.getOrderBy());
}
Aggregations