use of com.mysema.query.sql.SQLQuery in project SimpleFlatMapper by arnaudroger.
the class QueryDSLTest method testMappingProjection.
@Test
public void testMappingProjection() throws Exception {
Connection conn = DbHelper.objectDb();
SQLQuery sqlquery = new SQLQuery(conn, new HSQLDBTemplates());
try {
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));
assertEquals(1, list.size());
DbHelper.assertDbObjectMapping(list.get(0));
} finally {
conn.close();
}
}
Aggregations