Hi,

As I haven't heard from anyone on this, I'm trying again. 
Is this a known regression with the 1.0.0 version? Has anyone else
experienced the same problem or managed to use user-defined alias in report
queries with version 1.0.0? Should I provide more details? 

Thanks,

Cassio

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Friday, July 02, 2004 3:15 AM
To: [EMAIL PROTECTED]
Subject: RE: regression with use of alias in ReportQuery setAttributes?

I've reverted files SqlSelectStatement.java and SqlQueryStatement.java under
org.apache.ojb.broker.accesslayer.sql to versions 1.21 and 1.71
respectively, which I downloaded from the OJB CVS system, and that solved
the regression, my queries work as before. I don't need the pathClass-hint
stuff that I miss with this rollback for the moment, but I wonder what else
I might be missing, and if I'm running into a true regression or something
else.

Thanks again,

Cassio 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Friday, July 02, 2004 1:02 AM
To: [EMAIL PROTECTED]
Subject: regression with use of alias in ReportQuery setAttributes?

Hi,

 

I have some queries that used to work fine with OJB 1.0.RC6 and that fail
with OJB 1.0.RC7 and 1.0.0 (see sample below).

With RC6 I could use an alias to access an attribute to be added to the list
of attributes to be retrieved by my report query (method setAttributes) and
the generated SQL would map the alias to the appropriate variable used in an
inner join (A0, A1, A2, etc). Starting with RC7, the generated SQL is not
valid as the alias is not being mapped correctly but used literally instead
in the generated SQL query. 

 

crit.setAlias("ALIAS");

crit.addEqualTo("name", "xxx");

 

q = QueryFactory.newReportQuery(Container.class, crit);

 

String[] cols = { "ALIAS.value"};

q.setAttributes(cls);

 

Generated SQL query with RC6: select A1.value from Container A0... INNER
JOIN ... A1...

 

Generated SQL query with RC7 and 1.0.0: select ALIAS.value from Container
A0... INNER JOIN ... A1...

 

Am I doing something wrong? Is there a new way to make this feature work? Is
this a known issue? 

I couldn't find a unit test that uses this feature within the OJB
distribution, but the user doc still refers to it in the same way as before,
although I've noticed that there is a new UserAlias class in the broker
query API.

 

Thanks in advance for any help,

 

Cassio

 


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

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

Reply via email to