### Order Query Results Source: https://querydsl.github.io Selects persons and orders them by last name in ascending order, then by first name in descending order. ```java List persons = queryFactory.selectFrom(person) .orderBy(person.lastName.asc(), person.firstName.desc()) .fetch(); ``` -------------------------------- ### Tuple Projection Query Source: https://querydsl.github.io Selects the last name, first name, and year of birth for each person. ```java List tuples = queryFactory.select( person.lastName, person.firstName, person.yearOfBirth) .from(person) .fetch(); ``` -------------------------------- ### Basic Person Query Source: https://querydsl.github.io Selects persons from the database where the first name is 'John' and the last name is 'Doe'. ```java List persons = queryFactory.selectFrom(person) .where( person.firstName.eq("John"), person.lastName.eq("Doe")) .fetch(); ``` -------------------------------- ### Subquery for Person Size Source: https://querydsl.github.io Selects persons where the size of their children list equals the maximum size of children lists from all parents. ```java List persons = queryFactory.selectFrom(person) .where(person.children.size().eq( JPAExpressions.select(parent.children.size().max()) .from(parent))) .fetch(); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.