Thanks a lot Jakob!
That was the problem
-Ursprüngliche Nachricht-
Von: Jakob Braeuchi [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 13. März 2006 18:09
An: OJB Users List
Betreff: Re: AW: Problem joining two tables with same column name
hi josef,
you should not prefix the attribute
the problem is the incorrect obj_id without A2 as prefix :o(.
So, I get the following logical exception:
org.postgresql.util.PSQLException: ERROR: column reference "obj_id" is
ambiguous
Thanks a lot!
Josef Wagner
---- Original-Nachricht
Betreff:Re: AW: Problem
treff: Re: AW: Problem joining two tables with same column name
Datum: Fri, 03 Mar 2006 19:03:50 +0100
Von:Jakob Braeuchi <[EMAIL PROTECTED]>
Antwort an: OJB Users List
An: OJB Users List , [EMAIL PROTECTED]
Referenzen:
<[EMAIL PROTECTED]>
hi markus,
ojb 1.0
hi markus,
ojb 1.0.5 should be released this month.
you should always use 'attributes' not 'columns' in your queries and let
ojb translate the attribut-name into a column-name.
hth
jakob
ps: what do you use ojb for in bedag ?
Lauber Markus, Bedag schrieb:
Hi Jakob
Thank you for the expla
Hi Jakob
Thank you for the explanation. When will OJB 1.0.5 be released?
What do you suggest, is it better to use the method addEqualTo() or
addColumnEqualTo() in a project? In our project we used both methods and
we want to refactor our code.
Greetings
Markus
Hi Jakob
Your last tip (use addEqualto() instead of addColumnEqualTo()) solved my
problem.
Thank you very much for your help.
Cheers
Markus
hi markus,
imo the problem is addColumnEqualTo(). in the column-methods the
translation flag is false, which means that ojb does not try to
translate the attribute-name into a column-name (that's ok for columns).
but we also do not prefix the column-name with the alias, and this looks
like a
hi markus,
in your original post i saw that you use addColumnEqualTo
// c.setAlias("a1");
c.addColumnEqualTo("COLUMN1","034");
c.addColumnEqualTo("COLUMN2","78777");
// Criteria c2 = new Criteria();
what's the reason no to use addEqualTo() ?
jakob
Lauber Markus
hi markus,
do you have this problem on a 1:1 or 1:n relationship ?
could you eventually provide a test case ?
jakob
Lauber Markus, Bedag schrieb:
Hi Jakob
I switched to the new version of OJB (1.0.4). But the new release
brought no improvement in the generation of the SQL statement. It still
Hi Jakob
I switched to the new version of OJB (1.0.4). But the new release
brought no improvement in the generation of the SQL statement. It still
has no alias prefixes for the first table in the where clause.
SELECT A0.COLUMN1,A0.COLUMN2,A0.COLUMN3,A0.COLUMN4
FROM T1 A0,T2 A1 WHERE A0.ID=A1.T
10 matches
Mail list logo