FAQ
Is it possible to get the property names involved in an EJBQLQuery, eg, when the query returns type of Object[]?

For instance:

select m.firstName, m.lastName from Member m where...;

I'd love to be able to programmatically analyze a query like the above to learn that the query is select the "firstName" and "lastName" properties. Is this possible?

Robert

Search Discussions

  • Andrey Razumovsky at Jul 20, 2010 at 4:55 am
    Hi Robert,

    I used to do that by analyzing compiled expression tree:
    query.getExpression(BaseContext.getThreadObjectContext().getEntityResolver())
    ... and so on

    Regards,
    Andrey

    2010/7/20 Robert Zeigler <robert.zeigler@roxanemy.com>
    Is it possible to get the property names involved in an EJBQLQuery, eg,
    when the query returns type of Object[]?

    For instance:

    select m.firstName, m.lastName from Member m where...;

    I'd love to be able to programmatically analyze a query like the above to
    learn that the query is select the "firstName" and "lastName" properties. Is
    this possible?

    Robert
  • Robert Zeigler at Jul 20, 2010 at 8:25 pm
    Awesome, thanks; I was able to get exactly what I wanted out of expression, with a little digging.

    Robert
    On Jul 19, 2010, at 7/1911:54 PM , Andrey Razumovsky wrote:

    Hi Robert,

    I used to do that by analyzing compiled expression tree:
    query.getExpression(BaseContext.getThreadObjectContext().getEntityResolver())
    ... and so on

    Regards,
    Andrey

    2010/7/20 Robert Zeigler <robert.zeigler@roxanemy.com>
    Is it possible to get the property names involved in an EJBQLQuery, eg,
    when the query returns type of Object[]?

    For instance:

    select m.firstName, m.lastName from Member m where...;

    I'd love to be able to programmatically analyze a query like the above to
    learn that the query is select the "firstName" and "lastName" properties. Is
    this possible?

    Robert

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedJul 19, '10 at 10:56p
activeJul 20, '10 at 8:25p
posts3
users2
websitecayenne.apache.org

People

Translate

site design / logo © 2021 Grokbase