My use of cache in essence Foo was as follows
@Entity class Foo { @ManyToOne(fetch = LAZY) @Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) private Boo boo; @OneToMany @Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.READ_WRITE) private List<Bar> bars; }
How do I port this code to support JPA 2 as annotations using Hibernate 3.6.5
I know that we should use @Cacheable annotation at the entity level, but what should I use for cache declarations in
@ManyToOne and @OneToMany.
source share