You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by "giulio.cesare@gmail.com" <gi...@gmail.com> on 2021/10/27 17:14:30 UTC

Ordering objects by primary keys

Hello,

I am try to run some BBD tests integrated with Cayenne (succesfully, so
far).
I am at the point where I can not fully specify the record/object to select
in the test script, and so I am trying to select the latest object
inserted, matching some lose criteria.

Unfortunately, I don't have a generic "insertion date" in all my entities;
so the next best think I could think of, is to use the value of the PK
(generated using Postgres sequences) to sort the selected objects (DESC)
and picking the first match.

To achieve this, I have tried with this code:

String dbEntityName =
context.getEntityResolver().getObjEntity(entityName).getDbEntityName();
ImmutableList<Ordering> orderBy =
context.getEntityResolver().getDbEntity(dbEntityName).getPrimaryKeys().stream()
.map(attribute -> new Ordering(attribute.getName(), SortOrder.DESCENDING))
.collect(ImmutableList.toImmutableList())
;
BaseDataObject latestInstance =
ObjectSelect.query(clazz).orderBy(orderBy).selectFirst(context);

but I get the following error:
- Can't resolve path component: [{EntityName}.{primaryKeyFieldName}]

I realize that {EntityName} and {primaryKeyFieldName} live in two separate
contexts (Entities vs DB); but I have no more ideas on how to progress.

Does anyone have any suggestions on how to do this stunt?

Cheers,
Giulio Cesare

Re: Ordering objects by primary keys

Posted by "giulio.cesare@gmail.com" <gi...@gmail.com>.
My bad for missing it. 😕
Thanks for the reference; I will dig a little deeper into the AWESOME
documentation.
"Unfortunately", Cayenne is so smooth to use that I need to read the
documentation so rarely, that I have missed most of the updates since 3.1
(the first release of Cayenne I started using seriuosly, and which I did
read throughtly).

Thanks again for this great library!

Cheers,
Giulio Cesare

On Thu, Oct 28, 2021 at 8:45 AM Andrus Adamchik <aa...@gmail.com> wrote:

> Yeah, the expressions chapter mentions it:
>
> http://cayenne.apache.org/docs/4.1/cayenne-guide/#expressions <
> http://cayenne.apache.org/docs/4.1/cayenne-guide/#expressions>
>
>
> Andrus
>
>
> > On Oct 28, 2021, at 9:38 AM, giulio.cesare@gmail.com wrote:
> >
> > Is there any point in the documentation where this "db:" prefix has been
> > documented?
> >
> > Cheers,
> > Giulio Cesare
> >
> > On Wed, Oct 27, 2021 at 11:23 PM giulio.cesare@gmail.com <
> > giulio.cesare@gmail.com> wrote:
> >
> >> It did work! 🤩
> >>
> >> Thanks Nikita. 🙏
> >>
> >> Cheers,
> >>
> >> Giulio Cesare
> >>
> >>
> >> On Wed, Oct 27, 2021 at 7:46 PM Nikita Timofeev <
> ntimofeev@objectstyle.com>
> >> wrote:
> >>
> >>> Hi!
> >>>
> >>> You could try to add "db:" prefix to the primary key name.
> >>> Something like this: orderBy("db:ARTIST_ID")
> >>>
> >>> On Wed, Oct 27, 2021 at 8:14 PM giulio.cesare@gmail.com
> >>> <gi...@gmail.com> wrote:
> >>>>
> >>>> Hello,
> >>>>
> >>>> I am try to run some BBD tests integrated with Cayenne (succesfully,
> so
> >>>> far).
> >>>> I am at the point where I can not fully specify the record/object to
> >>> select
> >>>> in the test script, and so I am trying to select the latest object
> >>>> inserted, matching some lose criteria.
> >>>>
> >>>> Unfortunately, I don't have a generic "insertion date" in all my
> >>> entities;
> >>>> so the next best think I could think of, is to use the value of the PK
> >>>> (generated using Postgres sequences) to sort the selected objects
> (DESC)
> >>>> and picking the first match.
> >>>>
> >>>> To achieve this, I have tried with this code:
> >>>>
> >>>> String dbEntityName =
> >>>>
> context.getEntityResolver().getObjEntity(entityName).getDbEntityName();
> >>>> ImmutableList<Ordering> orderBy =
> >>>>
> >>>
> context.getEntityResolver().getDbEntity(dbEntityName).getPrimaryKeys().stream()
> >>>> .map(attribute -> new Ordering(attribute.getName(),
> >>> SortOrder.DESCENDING))
> >>>> .collect(ImmutableList.toImmutableList())
> >>>> ;
> >>>> BaseDataObject latestInstance =
> >>>> ObjectSelect.query(clazz).orderBy(orderBy).selectFirst(context);
> >>>>
> >>>> but I get the following error:
> >>>> - Can't resolve path component: [{EntityName}.{primaryKeyFieldName}]
> >>>>
> >>>> I realize that {EntityName} and {primaryKeyFieldName} live in two
> >>> separate
> >>>> contexts (Entities vs DB); but I have no more ideas on how to
> progress.
> >>>>
> >>>> Does anyone have any suggestions on how to do this stunt?
> >>>>
> >>>> Cheers,
> >>>> Giulio Cesare
> >>>
> >>>
> >>>
> >>> --
> >>> Best regards,
> >>> Nikita Timofeev
> >>>
> >>
>
>

Re: Ordering objects by primary keys

Posted by Andrus Adamchik <aa...@gmail.com>.
Yeah, the expressions chapter mentions it: 

http://cayenne.apache.org/docs/4.1/cayenne-guide/#expressions <http://cayenne.apache.org/docs/4.1/cayenne-guide/#expressions>


Andrus


> On Oct 28, 2021, at 9:38 AM, giulio.cesare@gmail.com wrote:
> 
> Is there any point in the documentation where this "db:" prefix has been
> documented?
> 
> Cheers,
> Giulio Cesare
> 
> On Wed, Oct 27, 2021 at 11:23 PM giulio.cesare@gmail.com <
> giulio.cesare@gmail.com> wrote:
> 
>> It did work! 🤩
>> 
>> Thanks Nikita. 🙏
>> 
>> Cheers,
>> 
>> Giulio Cesare
>> 
>> 
>> On Wed, Oct 27, 2021 at 7:46 PM Nikita Timofeev <nt...@objectstyle.com>
>> wrote:
>> 
>>> Hi!
>>> 
>>> You could try to add "db:" prefix to the primary key name.
>>> Something like this: orderBy("db:ARTIST_ID")
>>> 
>>> On Wed, Oct 27, 2021 at 8:14 PM giulio.cesare@gmail.com
>>> <gi...@gmail.com> wrote:
>>>> 
>>>> Hello,
>>>> 
>>>> I am try to run some BBD tests integrated with Cayenne (succesfully, so
>>>> far).
>>>> I am at the point where I can not fully specify the record/object to
>>> select
>>>> in the test script, and so I am trying to select the latest object
>>>> inserted, matching some lose criteria.
>>>> 
>>>> Unfortunately, I don't have a generic "insertion date" in all my
>>> entities;
>>>> so the next best think I could think of, is to use the value of the PK
>>>> (generated using Postgres sequences) to sort the selected objects (DESC)
>>>> and picking the first match.
>>>> 
>>>> To achieve this, I have tried with this code:
>>>> 
>>>> String dbEntityName =
>>>> context.getEntityResolver().getObjEntity(entityName).getDbEntityName();
>>>> ImmutableList<Ordering> orderBy =
>>>> 
>>> context.getEntityResolver().getDbEntity(dbEntityName).getPrimaryKeys().stream()
>>>> .map(attribute -> new Ordering(attribute.getName(),
>>> SortOrder.DESCENDING))
>>>> .collect(ImmutableList.toImmutableList())
>>>> ;
>>>> BaseDataObject latestInstance =
>>>> ObjectSelect.query(clazz).orderBy(orderBy).selectFirst(context);
>>>> 
>>>> but I get the following error:
>>>> - Can't resolve path component: [{EntityName}.{primaryKeyFieldName}]
>>>> 
>>>> I realize that {EntityName} and {primaryKeyFieldName} live in two
>>> separate
>>>> contexts (Entities vs DB); but I have no more ideas on how to progress.
>>>> 
>>>> Does anyone have any suggestions on how to do this stunt?
>>>> 
>>>> Cheers,
>>>> Giulio Cesare
>>> 
>>> 
>>> 
>>> --
>>> Best regards,
>>> Nikita Timofeev
>>> 
>> 


Re: Ordering objects by primary keys

Posted by Michael Gentry <bl...@gmail.com>.
I had 100% forgotten about MarkMail -- thanks for the reminder!


On Sat, Oct 30, 2021 at 4:09 AM Aristedes Maniatis <ar...@ish.com.au.invalid>
wrote:

> Its old, but still fast and works well:
> https://markmail.org/search/?q=list%3Aorg.apache.cayenne.user+%22db%3A%22
>
> Ari
>
>
> On 30/10/21 1:01am, Michael Gentry wrote:
> > Fun fact: I have years worth of Cayenne mailing list content in GMail,
> but
> > you can't search for db: in it because GMail uses prefix:term as an
> > advanced search option and it doesn't know what to do with db: ...
> >
> >
> > On Thu, Oct 28, 2021 at 2:38 AM giulio.cesare@gmail.com <
> > giulio.cesare@gmail.com> wrote:
> >
> >> Is there any point in the documentation where this "db:" prefix has been
> >> documented?
> >>
> >> Cheers,
> >> Giulio Cesare
> >>
> >> On Wed, Oct 27, 2021 at 11:23 PM giulio.cesare@gmail.com <
> >> giulio.cesare@gmail.com> wrote:
> >>
> >>> It did work! 🤩
> >>>
> >>> Thanks Nikita. 🙏
> >>>
> >>> Cheers,
> >>>
> >>> Giulio Cesare
> >>>
> >>>
> >>> On Wed, Oct 27, 2021 at 7:46 PM Nikita Timofeev <
> >> ntimofeev@objectstyle.com>
> >>> wrote:
> >>>
> >>>> Hi!
> >>>>
> >>>> You could try to add "db:" prefix to the primary key name.
> >>>> Something like this: orderBy("db:ARTIST_ID")
> >>>>
> >>>> On Wed, Oct 27, 2021 at 8:14 PM giulio.cesare@gmail.com
> >>>> <gi...@gmail.com> wrote:
> >>>>> Hello,
> >>>>>
> >>>>> I am try to run some BBD tests integrated with Cayenne (succesfully,
> >> so
> >>>>> far).
> >>>>> I am at the point where I can not fully specify the record/object to
> >>>> select
> >>>>> in the test script, and so I am trying to select the latest object
> >>>>> inserted, matching some lose criteria.
> >>>>>
> >>>>> Unfortunately, I don't have a generic "insertion date" in all my
> >>>> entities;
> >>>>> so the next best think I could think of, is to use the value of the
> PK
> >>>>> (generated using Postgres sequences) to sort the selected objects
> >> (DESC)
> >>>>> and picking the first match.
> >>>>>
> >>>>> To achieve this, I have tried with this code:
> >>>>>
> >>>>> String dbEntityName =
> >>>>>
> >> context.getEntityResolver().getObjEntity(entityName).getDbEntityName();
> >>>>> ImmutableList<Ordering> orderBy =
> >>>>>
> >>
> context.getEntityResolver().getDbEntity(dbEntityName).getPrimaryKeys().stream()
> >>>>> .map(attribute -> new Ordering(attribute.getName(),
> >>>> SortOrder.DESCENDING))
> >>>>> .collect(ImmutableList.toImmutableList())
> >>>>> ;
> >>>>> BaseDataObject latestInstance =
> >>>>> ObjectSelect.query(clazz).orderBy(orderBy).selectFirst(context);
> >>>>>
> >>>>> but I get the following error:
> >>>>> - Can't resolve path component: [{EntityName}.{primaryKeyFieldName}]
> >>>>>
> >>>>> I realize that {EntityName} and {primaryKeyFieldName} live in two
> >>>> separate
> >>>>> contexts (Entities vs DB); but I have no more ideas on how to
> >> progress.
> >>>>> Does anyone have any suggestions on how to do this stunt?
> >>>>>
> >>>>> Cheers,
> >>>>> Giulio Cesare
> >>>>
> >>>>
> >>>> --
> >>>> Best regards,
> >>>> Nikita Timofeev
> >>>>
>
>

Re: Ordering objects by primary keys

Posted by Aristedes Maniatis <ar...@ish.com.au.INVALID>.
Its old, but still fast and works well: 
https://markmail.org/search/?q=list%3Aorg.apache.cayenne.user+%22db%3A%22

Ari


On 30/10/21 1:01am, Michael Gentry wrote:
> Fun fact: I have years worth of Cayenne mailing list content in GMail, but
> you can't search for db: in it because GMail uses prefix:term as an
> advanced search option and it doesn't know what to do with db: ...
>
>
> On Thu, Oct 28, 2021 at 2:38 AM giulio.cesare@gmail.com <
> giulio.cesare@gmail.com> wrote:
>
>> Is there any point in the documentation where this "db:" prefix has been
>> documented?
>>
>> Cheers,
>> Giulio Cesare
>>
>> On Wed, Oct 27, 2021 at 11:23 PM giulio.cesare@gmail.com <
>> giulio.cesare@gmail.com> wrote:
>>
>>> It did work! 🤩
>>>
>>> Thanks Nikita. 🙏
>>>
>>> Cheers,
>>>
>>> Giulio Cesare
>>>
>>>
>>> On Wed, Oct 27, 2021 at 7:46 PM Nikita Timofeev <
>> ntimofeev@objectstyle.com>
>>> wrote:
>>>
>>>> Hi!
>>>>
>>>> You could try to add "db:" prefix to the primary key name.
>>>> Something like this: orderBy("db:ARTIST_ID")
>>>>
>>>> On Wed, Oct 27, 2021 at 8:14 PM giulio.cesare@gmail.com
>>>> <gi...@gmail.com> wrote:
>>>>> Hello,
>>>>>
>>>>> I am try to run some BBD tests integrated with Cayenne (succesfully,
>> so
>>>>> far).
>>>>> I am at the point where I can not fully specify the record/object to
>>>> select
>>>>> in the test script, and so I am trying to select the latest object
>>>>> inserted, matching some lose criteria.
>>>>>
>>>>> Unfortunately, I don't have a generic "insertion date" in all my
>>>> entities;
>>>>> so the next best think I could think of, is to use the value of the PK
>>>>> (generated using Postgres sequences) to sort the selected objects
>> (DESC)
>>>>> and picking the first match.
>>>>>
>>>>> To achieve this, I have tried with this code:
>>>>>
>>>>> String dbEntityName =
>>>>>
>> context.getEntityResolver().getObjEntity(entityName).getDbEntityName();
>>>>> ImmutableList<Ordering> orderBy =
>>>>>
>> context.getEntityResolver().getDbEntity(dbEntityName).getPrimaryKeys().stream()
>>>>> .map(attribute -> new Ordering(attribute.getName(),
>>>> SortOrder.DESCENDING))
>>>>> .collect(ImmutableList.toImmutableList())
>>>>> ;
>>>>> BaseDataObject latestInstance =
>>>>> ObjectSelect.query(clazz).orderBy(orderBy).selectFirst(context);
>>>>>
>>>>> but I get the following error:
>>>>> - Can't resolve path component: [{EntityName}.{primaryKeyFieldName}]
>>>>>
>>>>> I realize that {EntityName} and {primaryKeyFieldName} live in two
>>>> separate
>>>>> contexts (Entities vs DB); but I have no more ideas on how to
>> progress.
>>>>> Does anyone have any suggestions on how to do this stunt?
>>>>>
>>>>> Cheers,
>>>>> Giulio Cesare
>>>>
>>>>
>>>> --
>>>> Best regards,
>>>> Nikita Timofeev
>>>>


Re: Ordering objects by primary keys

Posted by Michael Gentry <bl...@gmail.com>.
Fun fact: I have years worth of Cayenne mailing list content in GMail, but
you can't search for db: in it because GMail uses prefix:term as an
advanced search option and it doesn't know what to do with db: ...


On Thu, Oct 28, 2021 at 2:38 AM giulio.cesare@gmail.com <
giulio.cesare@gmail.com> wrote:

> Is there any point in the documentation where this "db:" prefix has been
> documented?
>
> Cheers,
> Giulio Cesare
>
> On Wed, Oct 27, 2021 at 11:23 PM giulio.cesare@gmail.com <
> giulio.cesare@gmail.com> wrote:
>
> > It did work! 🤩
> >
> > Thanks Nikita. 🙏
> >
> > Cheers,
> >
> > Giulio Cesare
> >
> >
> > On Wed, Oct 27, 2021 at 7:46 PM Nikita Timofeev <
> ntimofeev@objectstyle.com>
> > wrote:
> >
> >> Hi!
> >>
> >> You could try to add "db:" prefix to the primary key name.
> >> Something like this: orderBy("db:ARTIST_ID")
> >>
> >> On Wed, Oct 27, 2021 at 8:14 PM giulio.cesare@gmail.com
> >> <gi...@gmail.com> wrote:
> >> >
> >> > Hello,
> >> >
> >> > I am try to run some BBD tests integrated with Cayenne (succesfully,
> so
> >> > far).
> >> > I am at the point where I can not fully specify the record/object to
> >> select
> >> > in the test script, and so I am trying to select the latest object
> >> > inserted, matching some lose criteria.
> >> >
> >> > Unfortunately, I don't have a generic "insertion date" in all my
> >> entities;
> >> > so the next best think I could think of, is to use the value of the PK
> >> > (generated using Postgres sequences) to sort the selected objects
> (DESC)
> >> > and picking the first match.
> >> >
> >> > To achieve this, I have tried with this code:
> >> >
> >> > String dbEntityName =
> >> >
> context.getEntityResolver().getObjEntity(entityName).getDbEntityName();
> >> > ImmutableList<Ordering> orderBy =
> >> >
> >>
> context.getEntityResolver().getDbEntity(dbEntityName).getPrimaryKeys().stream()
> >> > .map(attribute -> new Ordering(attribute.getName(),
> >> SortOrder.DESCENDING))
> >> > .collect(ImmutableList.toImmutableList())
> >> > ;
> >> > BaseDataObject latestInstance =
> >> > ObjectSelect.query(clazz).orderBy(orderBy).selectFirst(context);
> >> >
> >> > but I get the following error:
> >> > - Can't resolve path component: [{EntityName}.{primaryKeyFieldName}]
> >> >
> >> > I realize that {EntityName} and {primaryKeyFieldName} live in two
> >> separate
> >> > contexts (Entities vs DB); but I have no more ideas on how to
> progress.
> >> >
> >> > Does anyone have any suggestions on how to do this stunt?
> >> >
> >> > Cheers,
> >> > Giulio Cesare
> >>
> >>
> >>
> >> --
> >> Best regards,
> >> Nikita Timofeev
> >>
> >
>

Re: Ordering objects by primary keys

Posted by "giulio.cesare@gmail.com" <gi...@gmail.com>.
Is there any point in the documentation where this "db:" prefix has been
documented?

Cheers,
Giulio Cesare

On Wed, Oct 27, 2021 at 11:23 PM giulio.cesare@gmail.com <
giulio.cesare@gmail.com> wrote:

> It did work! 🤩
>
> Thanks Nikita. 🙏
>
> Cheers,
>
> Giulio Cesare
>
>
> On Wed, Oct 27, 2021 at 7:46 PM Nikita Timofeev <nt...@objectstyle.com>
> wrote:
>
>> Hi!
>>
>> You could try to add "db:" prefix to the primary key name.
>> Something like this: orderBy("db:ARTIST_ID")
>>
>> On Wed, Oct 27, 2021 at 8:14 PM giulio.cesare@gmail.com
>> <gi...@gmail.com> wrote:
>> >
>> > Hello,
>> >
>> > I am try to run some BBD tests integrated with Cayenne (succesfully, so
>> > far).
>> > I am at the point where I can not fully specify the record/object to
>> select
>> > in the test script, and so I am trying to select the latest object
>> > inserted, matching some lose criteria.
>> >
>> > Unfortunately, I don't have a generic "insertion date" in all my
>> entities;
>> > so the next best think I could think of, is to use the value of the PK
>> > (generated using Postgres sequences) to sort the selected objects (DESC)
>> > and picking the first match.
>> >
>> > To achieve this, I have tried with this code:
>> >
>> > String dbEntityName =
>> > context.getEntityResolver().getObjEntity(entityName).getDbEntityName();
>> > ImmutableList<Ordering> orderBy =
>> >
>> context.getEntityResolver().getDbEntity(dbEntityName).getPrimaryKeys().stream()
>> > .map(attribute -> new Ordering(attribute.getName(),
>> SortOrder.DESCENDING))
>> > .collect(ImmutableList.toImmutableList())
>> > ;
>> > BaseDataObject latestInstance =
>> > ObjectSelect.query(clazz).orderBy(orderBy).selectFirst(context);
>> >
>> > but I get the following error:
>> > - Can't resolve path component: [{EntityName}.{primaryKeyFieldName}]
>> >
>> > I realize that {EntityName} and {primaryKeyFieldName} live in two
>> separate
>> > contexts (Entities vs DB); but I have no more ideas on how to progress.
>> >
>> > Does anyone have any suggestions on how to do this stunt?
>> >
>> > Cheers,
>> > Giulio Cesare
>>
>>
>>
>> --
>> Best regards,
>> Nikita Timofeev
>>
>

Re: Ordering objects by primary keys

Posted by "giulio.cesare@gmail.com" <gi...@gmail.com>.
It did work! 🤩

Thanks Nikita. 🙏

Cheers,

Giulio Cesare


On Wed, Oct 27, 2021 at 7:46 PM Nikita Timofeev <nt...@objectstyle.com>
wrote:

> Hi!
>
> You could try to add "db:" prefix to the primary key name.
> Something like this: orderBy("db:ARTIST_ID")
>
> On Wed, Oct 27, 2021 at 8:14 PM giulio.cesare@gmail.com
> <gi...@gmail.com> wrote:
> >
> > Hello,
> >
> > I am try to run some BBD tests integrated with Cayenne (succesfully, so
> > far).
> > I am at the point where I can not fully specify the record/object to
> select
> > in the test script, and so I am trying to select the latest object
> > inserted, matching some lose criteria.
> >
> > Unfortunately, I don't have a generic "insertion date" in all my
> entities;
> > so the next best think I could think of, is to use the value of the PK
> > (generated using Postgres sequences) to sort the selected objects (DESC)
> > and picking the first match.
> >
> > To achieve this, I have tried with this code:
> >
> > String dbEntityName =
> > context.getEntityResolver().getObjEntity(entityName).getDbEntityName();
> > ImmutableList<Ordering> orderBy =
> >
> context.getEntityResolver().getDbEntity(dbEntityName).getPrimaryKeys().stream()
> > .map(attribute -> new Ordering(attribute.getName(),
> SortOrder.DESCENDING))
> > .collect(ImmutableList.toImmutableList())
> > ;
> > BaseDataObject latestInstance =
> > ObjectSelect.query(clazz).orderBy(orderBy).selectFirst(context);
> >
> > but I get the following error:
> > - Can't resolve path component: [{EntityName}.{primaryKeyFieldName}]
> >
> > I realize that {EntityName} and {primaryKeyFieldName} live in two
> separate
> > contexts (Entities vs DB); but I have no more ideas on how to progress.
> >
> > Does anyone have any suggestions on how to do this stunt?
> >
> > Cheers,
> > Giulio Cesare
>
>
>
> --
> Best regards,
> Nikita Timofeev
>

Re: Ordering objects by primary keys

Posted by Nikita Timofeev <nt...@objectstyle.com>.
Hi!

You could try to add "db:" prefix to the primary key name.
Something like this: orderBy("db:ARTIST_ID")

On Wed, Oct 27, 2021 at 8:14 PM giulio.cesare@gmail.com
<gi...@gmail.com> wrote:
>
> Hello,
>
> I am try to run some BBD tests integrated with Cayenne (succesfully, so
> far).
> I am at the point where I can not fully specify the record/object to select
> in the test script, and so I am trying to select the latest object
> inserted, matching some lose criteria.
>
> Unfortunately, I don't have a generic "insertion date" in all my entities;
> so the next best think I could think of, is to use the value of the PK
> (generated using Postgres sequences) to sort the selected objects (DESC)
> and picking the first match.
>
> To achieve this, I have tried with this code:
>
> String dbEntityName =
> context.getEntityResolver().getObjEntity(entityName).getDbEntityName();
> ImmutableList<Ordering> orderBy =
> context.getEntityResolver().getDbEntity(dbEntityName).getPrimaryKeys().stream()
> .map(attribute -> new Ordering(attribute.getName(), SortOrder.DESCENDING))
> .collect(ImmutableList.toImmutableList())
> ;
> BaseDataObject latestInstance =
> ObjectSelect.query(clazz).orderBy(orderBy).selectFirst(context);
>
> but I get the following error:
> - Can't resolve path component: [{EntityName}.{primaryKeyFieldName}]
>
> I realize that {EntityName} and {primaryKeyFieldName} live in two separate
> contexts (Entities vs DB); but I have no more ideas on how to progress.
>
> Does anyone have any suggestions on how to do this stunt?
>
> Cheers,
> Giulio Cesare



-- 
Best regards,
Nikita Timofeev