16.1. Hibernate in a web application

We emphasized the importance of disciplined application layering in chapter 1. Layering helps achieve separation of concerns, making code more readable by grouping code that does similar things. Layering, however, carries a price. Each extra layer increases the amount of code it takes to implement a simple piece of functionality—and more code makes the functionality more difficult to change.

In this section, we show you how to integrate Hibernate in a typical layered application. We assume that you want to write a simple web application with Java servlets. We need a simple use case of the CaveatEmptor application to demonstrate these ideas.

16.1.1. Introducing the use case

When a user places a bid on an ...

Get Java Persistence with Hibernate now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.