Getting Started QueryDsl

Maven Central JavaDoc

Setting up the environment

Add the Dependency to your build.

for Maven:

Java 8, 9, 10 , 11 no module-info

<dependency>
    <groupId>org.simpleflatmapper</groupId>
    <artifactId>sfm-querydsl</artifactId>
    <version>8.2.3</version>
</dependency>

Java 6, 7

<dependency>
    <groupId>org.simpleflatmapper</groupId>
    <artifactId>sfm-querydsl-jre6</artifactId>
    <version>8.2.3</version>
</dependency>

Java 9, 10 , 11 with module-info

<dependency>
    <groupId>org.simpleflatmapper</groupId>
    <artifactId>sfm-querydsl-jre9</artifactId>
    <version>8.2.3</version>
</dependency>

From 7.0.0 you will need explicitly include the querydsl dependency in your pom.

SQLQuery sqlquery = new SQLQuery(conn, new HSQLDBTemplates());
 List<DbObject> list = 
    sqlquery
        .from(qTestDbObject)
        .where(qTestDbObject.id.eq(1l))
        .list(
            new QueryDslMappingProjection<DbObject>(
                DbObject.class, 
                qTestDbObject.id,
                qTestDbObject.name, 
                qTestDbObject.email, 
                qTestDbObject.creationTime, 
                qTestDbObject.typeName, 
                qTestDbObject.typeOrdinal));