I just realized that my issue had to do with my parenthesis, Your solution worked. Thank you so much for the help.
On Wed, Feb 7, 2024 at 11:22 AM Jurgen Doll <jur...@ivoryemr.co.za> wrote: > Try the following version and see if it works for you: > > ObjectSelect.query( ObjectEntityA.class ) > .columns( > ObjEntityA.PROP_FOR_OBJECT_B > .dot( ObjEntityB.PROP_FOR_OBJECT_C ) > .dot( ObjEntityC.PROP_FOR_OBJECT_D ) > .count() > ) > .where( > ObjEntityA.PROP_FOR_OBJECT_E > .dot( ObjEntityE.PROP ) > .eq( someValue ) > ) > .select( context ) > > > > > On Wed, 07 Feb 2024 19:25:34 +0200, Christian Gonzalez > <christian.gonza...@smartscrubs.com> wrote: > > > One last question, I was trying to update another query using the same > > method of identifying the wanted columns when trying to fetch from a > > different ObjectEntity than the one from the ObjectSelect. The issue > > seems > > to be that the column I'm selecting is the pk column of another > > ObjectEntity? The query I'm doing looks something like this. > > > ObjectSelect.query(ObjectEntityA.class).columns(ObjEntityA.PROP_FOR_OBJECT_B.dot(ObjEntityB.PROP_FOR_OBJECT_C.dot(ObjEntityC.PROP_FOR_OBJECT_D.dot(ObjEntityD.ENTITY_D_PK_PROP).count()))).where(ObjEntityA.PROP_FOR_OBJECT_E.dot(ObjEntityE.PROP).eq(someValue)).select(context). > > However this returns an error that says "Can't translate dbid path > > 'dbEntityB.dbEntityDPKAttribute', no such pk ''. I know cayenne > > usually doesn't include pk property's however we use cgen to generate the > > java classes and have the flag createPKProperties set to true so the > > properties get generated. Could this be a part of the issue or am I doing > > the query wrong? > > > -- > Using Opera's mail client: http://www.opera.com/mail/ >