JPA filtering entities from a mapped association
问题 My friendships sql table has column friend_1, friend_2, status . I have the following mappings in my (snippet below) User class. Currently user.getInitiatedFriendships returns list of Friendships where value of column friend_1 is equal to ID of the user I'm calling this getter on. user.getInvitedToFriendships() returns Friendships where column friend_2 is equal to ID of this user. I want to know if it is possible to add something to this line @OneToMany(mappedBy = "invitingUser" +>some check