Hi Timo,
Thanks very much for the direction. I must be misunderstanding some detail - the below code will produce the "Undeclared path 'aliasField'. Add this path as a source..." error when I try to run it. I also don't have the .on() join specifier method available to chain after leftJoin() (making me think I must be using the wrong query class?), and am not sure what kind of object subQueryResults is in your example. Sorry to be so dull :) is there something obviously wrong with the below?
Thanks,
Steve
---
JPAQuery query = new JPAQuery();
JPASubQuery subquery = new JPASubQuery();
QSomeTable t1 = new QSomeTable("t1");
QSomeSubtable t3 = new QSomeSubtable("t3");
StringPath aliasField = Expressions.stringPath("aliasField");
query.from(t1)
.leftJoin(
subquery.from(t3).list(
t3.parent.pk, new CaseBuilder()
.when(t3.someSubField.between(new Integer(76), new Integer(100))).then(HIGH)
.when(t3.someSubField.between(new Integer(51), new Integer (75))).then(MED)
.when(t3.someSubField.between(new Integer(0), new Integer(50))).then(LOW)
.otherwise("null").as(aliasField))) // Is there a null dropin object to use in place of literal null?
// No .on() specifier for the join available here?
.where(t1.field1.eq(1), t1.field2.eq("A"))
.groupBy(t1.field1, t1.field2, aliasField)
.list(t1.field1, t1.field2, aliasField, Wildcard.count);
---
On Monday, July 16, 2012 4:19:48 PM UTC-4, Timo Westkämper wrote:
Hi.