I have 3 tables. applications, users and applications_users.
applications and users have a many-to-many relationship and I'm using
applications_users to relate the 2 together. Also a user can different
roles per application so I have added a role field in
applications_users. e.g. user1 can be contact person in application X
while in application Y, user1 can be researcher and contact person at
the same time.

I have the following entries in my transfer.xml (http://
www.pastebin.ca/1587287) to represent the 3 tables.

This the onetomany relationship (1 record in users table can have many
records in applications_users table). I am able to join users and
applications_users. This is my actual code that performs the join
(http://www.pastebin.ca/1587281).

The problem is that when I try to insert (using transfer.save
function) a record to application_users, I get DB errors. I debugged
QueryExecution.cfc (part of transfer), it seems my onetomany
relationship is the cause of the problem.

e.g. (the sql was obtained after debugging QueryExecution)
correct sql (without onetomany in users object): insert into
applications_users (application_id, user_id, role, access_type) values
(...

wrong sql (with onetomany in users object): insert into
applications_users (application_id, user_id, role, access_type,
user_id) values(...

As can be seen, the user_id is doubling up. I have removed the
onetomany relationship in users but my join (see 2nd link from
pastebin.ca) doesn't work anymore.
--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to