Re: Expression to compare a property against another property

Michael Gentry <[email protected]>
Newsgroups gmane.comp.java.cayenne.user
Message-ID <CAOy5kzPLsE20TciqrguE4GSMCw+jb0xMMdwDHFy4zVUsgCybuw@mail.gmail.com>
Hi Faizel,

What version of Cayenne are you using?  That will influence the feedback we
can provide.


On Thu, Sep 10, 2020 at 5:00 PM Faizel Dakri <[email protected]> wrote:

> Is there a facility in Cayenne to create an expression that would compare
> a property of one object against another property (maybe via a relationship
> path rooted at the same object) rather than against a scalar value?
>
> I’m trying to port over some old EOF code and we used to have a
> EOKeyComparisonQualifier which would allow you to create a qualifier to
> compare a property’s value with that of another property (or property key
> path).
>
> For example, given a model consisting of employees, where each employee
> can have a relationship to a manager and each employee has a salary
> property, you could use a key comparison qualifier to find those employees
> that are making more than their manager:
>
>         salary > manager.salary
>
> I’ve looked in ExpressionFactory and through some of the source, but to me
> it looks like all comparison nodes in an expression operate on a key and a
> scalar. Am I missing something?
>
> Thanks for any help or pointers,
>
> F
>
> --
> Faizel Dakri
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.