Re: Emulating left outer joins with JDOQL

2016-01-28 Thread Dan Haywood
Could you copy all the relevant code so that I can write this up as an faq ? On 28 Jan 2016 17:17, "Willie Loyd Tandingan" wrote: > It worked! "datanucleus.query.jdoql.{varName}.join" had to be set to > OUTERJOIN for both pt and t. Thanks! > > On Sun, Jan 24, 2016 at

Re: Emulating left outer joins with JDOQL

2016-01-28 Thread Willie Loyd Tandingan
It worked! "datanucleus.query.jdoql.{varName}.join" had to be set to OUTERJOIN for both pt and t. Thanks! On Sun, Jan 24, 2016 at 2:45 AM, Willie Loyd Tandingan < tandingan@gmail.com> wrote: > I'm gonna try that one back at work next week. Thanks! > > Admittedly, I thought of that one before

Re: Emulating left outer joins with JDOQL

2016-01-28 Thread Willie Loyd Tandingan
The setup was as follows: final Query query = getJdoPersistenceManager().newQuery(Employee.class); query.setResult("this, p"); query.setResultClass(EmployeePayslipTemplate.class); query.setFilter("ept.employee == this && ept.payslipTemplate == p");

Re: Emulating left outer joins with JDOQL

2016-01-28 Thread Jeroen van der Wal
Very elegant, nice! On 28 January 2016 at 18:55, Willie Loyd Tandingan wrote: > The setup was as follows: > > final Query query = getJdoPersistenceManager().newQuery(Employee.class); > query.setResult("this, p"); > query.setResultClass(EmployeePayslipTemplate.class); >

Re: Emulating left outer joins with JDOQL

2016-01-23 Thread Jeroen van der Wal
Thanks for correcting Andy. I learned now that you can create a List collection from a JDOQL query, nice! Apache Isis however can only render List collections. Would make a nice feature though to support List rendering (pivot tables anyone?). On 22 January 2016 at 20:36, Andy

Re: Emulating left outer joins with JDOQL

2016-01-23 Thread Willie Loyd Tandingan
I'm gonna try that one back at work next week. Thanks! Admittedly, I thought of that one before but didn't try it out since I thought it would generate an inner join instead and didn't think of turning SQL logging on. We tried this erroneous funny query which we thought was kind of correct but DN

Re: Emulating left outer joins with JDOQL

2016-01-22 Thread Andy Jefferson
On Friday 22 Jan 2016 19:25:24 Andy Jefferson wrote: > > > SELECT p.*, t.* FROM Person p > > > LEFT JOIN PersonTemplate pt ON p.id = pt.personId > > > LEFT JOIN Template t ON pt.templateId = t.id > > > > > > With this query, I can get Persons even if they don't have a Template. > > Which is what

Re: Emulating left outer joins with JDOQL

2016-01-22 Thread Andy Jefferson
> The query I'd like to perform is something like: > > SELECT p.*, t.* FROM Person p > LEFT JOIN PersonTemplate pt ON p.id = pt.personId > LEFT JOIN Template t ON pt.templateId = t.id > > With this query, I can get Persons even if they don't have a Template. Which is what you would do if you

Re: Emulating left outer joins with JDOQL

2016-01-22 Thread Andy Jefferson
> > SELECT p.*, t.* FROM Person p > > LEFT JOIN PersonTemplate pt ON p.id = pt.personId > > LEFT JOIN Template t ON pt.templateId = t.id > > > > With this query, I can get Persons even if they don't have a Template. > Which is what you would do if you followed the example I suggested, using >

Re: Emulating left outer joins with JDOQL

2016-01-22 Thread Willie Loyd Tandingan
The query I'd like to perform is something like: SELECT p.*, t.* FROM Person p LEFT JOIN PersonTemplate pt ON p.id = pt.personId LEFT JOIN Template t ON pt.templateId = t.id With this query, I can get Persons even if they don't have a Template. On Fri, Jan 22, 2016 at 3:05 AM, Andy Jefferson

Re: Emulating left outer joins with JDOQL

2016-01-22 Thread Jeroen van der Wal
AFAIK you cannot return two types in a single query with JDOQL You could contribute the template on the the person class: @DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY) public class PersonTemplateContributions { @Action(semantics = SemanticsOf.SAFE)

Re: Emulating left outer joins with JDOQL

2016-01-21 Thread Andy Jefferson
> Person > - String name > > Template > - String name > - String field1 > - boolean otherBunchOfProperties > > PersonTemplate > - Person person > - Template template > I want to query all Persons along with their corresponding Template > through PersonTemplate. > Adding the Template property