Daniel,
I still cannot reproduce your error
select * from TEST_LENDING;
select * from TEST_GROUP;
select * from TEST_PERSON;
L_ID G_ID
---------- ----------
100 20
G_ID
----------
10
20
P_ID G_ID L_ID
---------- ---------- ----------
1 10 100.
I used your code below and get
[{'1','10','100','100','20'}]
I use the current version of the TORQUE_3_1_BRANCH from CVS, but this
version uses the same version of village, so this should not be the
problem.
Perhaps you have uncommited data on a connection you use that is not
visible to other connections/applications ?
I am quite sure that village is not the problem here.
Thomas
"Vitzethum, Daniel" <[EMAIL PROTECTED]> schrieb am 15.12.2004
11:54:01:
> Hi Richard, Hi Thomas,
>
> Thomas:
> > I suppose you use your JoinHelper.
> you are right, as usual ;-)
>
> > Are you sure it is not a bug in there ?
> I am, as I had tested the same situation with just two tables
> joined with a Torque-generated "doSelectJoin..." method.
>
> The problem is a bit different, I will try to explain:
> (pk = Primary Key, fk = Foreign Key)
>
> table TEST_PERSON
> pk P_ID (in example: 1)
> fk G_ID (in example: 10)
> fk L_ID (in example: 100)
>
> table TEST_LENDING (a person can be lended to an other group)
> pk L_ID (in example: 100)
> fk G_ID (in example: 20) !!
>
> table TEST_GROUP
> pk G_ID (in example: 10 and 20)
>
>
> I can reproduce the following behavior:
>
> Select directly on DB:
> SELECT
> a.g_id, b.g_id
> FROM
> test_person a, test_lending b
> WHERE
> a.l_id = b.l_id
> returns correctly:
> 10 (for a.g_id) and 20 (for b.g_id)
>
> This code:
> Criteria cr = new Criteria();
> cr.addJoin(TestPersonPeer.L_ID, TestLendingPeer.L_ID);
> TestPersonPeer.addSelectColumns(cr);
> TestLendingPeer.addSelectColumns(cr);
> List list = TestPersonPeer.doSelectVillageRecords(cr);
> Record record = (Record) list.get(0);
>
> builds a correct Criteria with qualified columns that works
> well on DB:
> SELECT
> TEST_PERSON.P_ID, TEST_PERSON.G_ID, TEST_PERSON.L_ID
> , TEST_LENDING.L_ID, TEST_LENDING.G_ID
> FROM
> TEST_PERSON
> , TEST_LENDING
> WHERE
> TEST_PERSON.L_ID=TEST_LENDING.L_ID
>
> but leads to the following Record object:
> {'1','10','100','100','10'}
> ^^ ^^
> right / wrong! /
>
>
> I still come to the conclusion that there is something wrong in village.
> If you agree, I will try to bring this to the village developers.
>
>
> Thank your very much,
>
> Daniel
>
> ---------------------------------------------------------------------
> 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]