So far, we have used a simple persistent class,
Student, in our example. As mentioned in Chapter 1, most persistent classes are not so simple. Many are not plain as they may be inherited from or associated with others. As a persistence provider, Hibernate should handle these cases. We'll see more about this in Chapter 5. For now, let's look at how Hibernate caches objects, and how to query the objects we've mapped.
Regarding performance enhancement, Hibernate provides two caches, each in a different level. As the first-level cache, each
Session object has its own cache, which is also called transactional cache. This cache holds the persistent objects of
Session, and minimizes database interactions, thereby enhancing ...