Hello, sorry the poor english.
Well, I'm doing a little project where I have a entity name User, and this is mapped ok.
But I want increment adding a following idea: - A User can be friend of other User, in other words, a User can have a list of User (friends)
In MySQL table, I create a table User, i'ts ok, and I create other table name friend which I put two primary keys, the id of the user and the id of the friend, like this: -------- | 1 | 2 | --------
I wonder, how can I do this using just hibernate? Something like: "From User Inner Join Friend On (User.id = Friend.id_primary And Friend.id_secundary = 1)" (in case, "1" is the id of the User that I want retrieve the friends...
Thanks anyway :)
|