Re: ERXEOControlUtilities and derived attributes

From: Daniel Roy (daniel.ro..uegodigitalmedia.com)
Date: Mon Jul 07 2008 - 21:25:38 EDT

  • Next message: Lachlan Deck: "Re: Maven Skepticism"

    Apologies. Thanks for the clarification.

    On 7-Jul-08, at 8:16 PM, Lachlan Deck wrote:

    > On 08/07/2008, at 6:01 AM, Daniel Roy wrote:
    >
    >> I've run into an issue and would appreciate some feedback from the
    >> community. I'm trying to do a count on a number of distinct rows
    >> in one table of my database. The rows are made distinct by the
    >> combination of two attributes, A and B. After discussing it, an
    >> attempt was made to use a derived attribute in the EO model to
    >> represent the combination of A and B. The derived definition value
    >> used was "A||'_'||B" (minus the double quotes - this is postgres
    >> format). Then, to do the count, I used
    >> [ERXEOControlUtilities.objectCountUniqueWithQualifierAndAttribute]
    >> and specified my derived attribute's name for [attributeName] of
    >> the method. When I run the application, the SQL that is generated
    >> is incorrect because the underlying code in
    >> [EOEnterpriseObjectClazz.objectCountUniqueAttribute] is expecting
    >> the given attribute to have a column name. Derived attributes do
    >> not have a column name, so the resulting SQL looks like this:
    >>
    >> "SELECT count( distinct t0.null) FROM BLAH t0"
    >>
    >> I know the derived attribute is being evaluated properly, since I
    >> can output the attribute's correct value by looping over the result
    >> set. I could also avoid using
    >> [ERXEOControlUtilities.objectCountUniqueWithQualifierAndAttribute]
    >> by simply doing a fetch and looping over the result set and keeping
    >> track of the count, but I don't actually need the objects in memory
    >> - all I need is the count.
    >>
    >> Am I going about this the wrong way? Is this something that should
    >> be addressed in [EOEnterpriseObjectClazz]?
    >
    > This is a question for the wonder-dis..ists.sourceforge.net mailing
    > list.
    >
    > with regards,
    > --
    >
    > Lachlan Deck
    >
    >
    >





    This archive was generated by hypermail 2.0.0 : Mon Jul 07 2008 - 21:26:35 EDT