So obviously when you enable 2nd level caching with ehcache, Hibernate will go through all your entity classes and create a bunch of ehcache instances based on the annotations / metadata defined for those classes.
I'm looking for insight into the low level details of how Hibernate does that.
For example, if I have a class like this:
Code:
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "Player")
@org.hibernate.annotations.Cache(usage =
org.hibernate.annotations.CacheConcurrencyStrategy.NONSTRICT_READ_WRITE
)
public class BasketballPlayer {
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "team_id")
@org.hibernate.annotations.Cache(usage =
org.hibernate.annotations.CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private BasketballTeam team;
.... non-relevant stuff omitted ...
}
I'm looking for the Hibernate code that inspects this class and creates the ehcache instances + relationships between BasketballPlayer and BaskeballTeam (from seeing the @Entity, @Cache and @ManyToOne annotations).
Can someone help me out and point me in the right direction?