Getting Started QueryDsl

Maven Central JavaDoc

Setting up the environment

Add the Dependency to your build.

for Maven:

Java 8

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

Java 6, 7

<dependency>
    <groupId>org.simpleflatmapper</groupId>
    <artifactId>sfm-querydsl</artifactId>
    <version>3.13.2</version>
    <classifier>jdk16</classifier>
</dependency>

Java 9

<dependency>
    <groupId>org.simpleflatmapper</groupId>
    <artifactId>sfm-querydsl</artifactId>
    <version>3.13.2</version>
    <classifier>jdk9ea</classifier>
</dependency>
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));