Hi,

Want to implement a feature to allow a user to block a list of other users. The use case is for any given user id, find the list of users he blocks.

I use a many-to-many relationship table to map the relationship:
user1_id, user2_id

Since there might be a huge long list of users a user want to block, I don't want to keep a list of blockedUsers inside my user data object. May even need to implement pagination to show the list of blocked users.

What's the best way I can use Hibernate to maintain the relationship and answer query like: findBlockedUserListByUserId(userId).

Should I use native SQL with addEntity? Is there a better way? If the same question has been asked,  a pointer of that thread would help.

thanks!
Derek