A Q-type is a generated Querydsl metamodel class corresponding to a JPA entity. Annotation processing creates one class per entity during the Maven build, and mirrors queryable fields with typed Querydsl paths such as StringPath and NumberPath<Long>. section 19.2.1
The generated classes are placed under target/generated-sources/java and expose static instances used as query roots. JPAQueryFactory creates JPAQuery objects that use these roots to build database queries. section 19.3 section 19.3.1
Filtering with a Q-type
QUser.user identifies the User entity, while username provides a typed predicate. The query returns one matching entity, returns null when none matches, and throws NonUniqueResultException when several match. section 19.3.1
public static final QUser user = new QUser("user");
public static final QBid bid = new QBid("bid");
public static final QAddress address = new QAddress("address");
Generated static query roots for User, Bid, and Address. section 19.3.1
Configure querydsl-jpa, querydsl-apt, and the Maven APT plugin to generate Q-types. Use the JPA annotation processor for JPA entities; the annotation-processing dependency is needed at build time rather than in application artifacts. section 19.2.1
