Thanks. Don't think it is the answer I am looking for. It is not about Admin user. Any user can block any user (from sending message to them and ...).
Again, I don't want to keep a list of blockedUsers in my user data object. What's the best way to map the relationship and build a query like findBlockedUsersByUserId() using hibernate?
I can only think about using native query.
Sagi wrote:
if the case is like this.... one admin user can block n number of users and one user can be blocked by many admin users..
then the relation can be defined in following way...
User_table
*User_id
User_Name
Admin_Table
*admin_id
*user_id
both of the above id refer to user_id in user_table...
this will be a bi-diectional one-to-many relation.
ur findBlockedUserListByUserId(userId) will fire a query on user_table and probably return list of user_id's