I have the next problem: I have a "User" entity with a many to many relationship to "Roles". The thing is, the "Roles" are enumerated (there are always 5 of them) so fetching them whenever i fetch a user seems unnecessary (as they also rarely change). I would like to somehow keep the roles in memory and attach them to the user whenever i bring her. It is worth noting that hibernate has 2nd level cache enabled so i will be able to utilize this if necessary. Does anyone have a solution for this?
thanks in advance