I just changed my database schema such that one of my tables now has a
primary key field whose name is different than the column name in the
database.

Things worked OK in general until I referenced the table from another
table via an M:N association. I then got an SQL exception complaining
that I was trying to access the table using the field name, not the
column name.

I think I've traced the problem to PersistenceBrokerImpl.getCount(Query)
- in this routine a report query is made, but it's being populated with
attribute names, not column names. The offending lines of code:

for (int i = 0; i < pkFields.length; i++)
{
    if (query.isDistinct())
    {
        columns[i] = "count(distinct " + pkFields[i].getAttributeName()
+ ")";
    }
    else
    {
        columns[i] = "count(" + pkFields[i].getAttributeName() + ")";
    }
}

Should the above getAttributeName() calls should be replaced with
getColumnName() instead?

Regards,
Scott Howlett

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to