java - JPA with hibernate provider many-to-many fetch mode -



java - JPA with hibernate provider many-to-many fetch mode -

i have 2 jpa entities user , course:

@entity public class user { @id @generatedvalue private integer id; @manytomany @jointable(name="usercourse") private set<course> courses; // getters , setters } @entity @cacheable public class course of study { @id @generatedvalue private integer id; // getters , setters }

course cacheable. hibernate.max_fetch_depth set 0.

what need when iterate through user's courses, hibernate should fire simple select query fetch courses join-table usercourse , load course of study entity l2 cache. instead, hibernate seem firing join-query between usercourse , course.

so question - in case of manytomany association, there way forcefulness hibernate fire simple non-join select on join-table , fetch related cacheable entity l2 cache?

java hibernate jpa

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -