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]