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

 

Reply via email to