O'Reilly logo

Spring Persistence with Hibernate by Ahmad Seddighi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Some issues in mapping

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.

Caching

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required