• Post Reply Bookmark Topic Watch Topic
  • New Topic

mapping multiple assosiations

 
Kevin Fitzpatrick
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am looking for some help with code i am developing, I have 3 entity classes Organisation, Groups and Users. Organisation is the parent class which has a list of Groups and Group has a list of Users. The assosiation between Tables looks as follows:

organisation
organisationId (PK)

Group
groupId (PK)
organisation_id(FK)

User
userId (PK)
group_id (FK)

The problem is that the when i save an organisation the mapping between organisation and groups is fine, but missing some of the assosiation between groups and users. I believe this is due to some of the users are updating instead of inserting. Here is the mapping files that i am using, any help would be welcome.

 
Kevin Fitzpatrick
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I managed to find out what the problem was, the code i posted works fine, it was an issue with my test data. Thanks
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!