Hi all,
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]?
Thanks in advance,
Daniel
This archive was generated by hypermail 2.0.0 : Mon Jul 07 2008 - 16:02:08 EDT