Now it's even worse. In the second try, neither one of the entity was loaded from the 2nd level cache:
INFO [Alice]: c.v.h.m.l.DefaultCacheStrategySettingsTest - First try DEBUG [Alice]: n.t.d.l.SLF4JQueryLoggingListener - Name: Time:0 Num:1 Query:{[select defaultcac0_.id as id1_0_0_, defaultcac0_.name as name2_0_0_ from Repository defaultcac0_ where defaultcac0_.id=?][1]} DEBUG [Alice]: n.t.d.l.SLF4JQueryLoggingListener - Name: Time:0 Num:1 Query:{[select defaultcac0_.id as id1_1_0_, defaultcac0_.name as name2_1_0_ from RepositoryWithExplicitCacheStrategy defaultcac0_ where defaultcac0_.id=?][1]} DEBUG [Alice]: o.h.e.i.AbstractFlushingEventListener - Processing flush-time cascades DEBUG [Alice]: o.h.e.i.AbstractFlushingEventListener - Dirty checking collections DEBUG [Alice]: o.h.e.i.AbstractFlushingEventListener - Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects DEBUG [Alice]: o.h.e.i.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections INFO [Alice]: c.v.h.m.l.DefaultCacheStrategySettingsTest - Second try DEBUG [Alice]: n.t.d.l.SLF4JQueryLoggingListener - Name: Time:0 Num:1 Query:{[select defaultcac0_.id as id1_0_0_, defaultcac0_.name as name2_0_0_ from Repository defaultcac0_ where defaultcac0_.id=?][1]} DEBUG [Alice]: n.t.d.l.SLF4JQueryLoggingListener - Name: Time:0 Num:1 Query:{[select defaultcac0_.id as id1_1_0_, defaultcac0_.name as name2_1_0_ from RepositoryWithExplicitCacheStrategy defaultcac0_ where defaultcac0_.id=?][1]} DEBUG [Alice]: o.h.e.i.AbstractFlushingEventListener - Processing flush-time cascades