Chapter 8. Legacy databases and custom SQL

Many examples presented in this chapter are about "difficult" mappings. The first time you'll likely have problems creating a mapping is with a legacy database schema that can't be modified. We discuss typical issues you encounter in such a scenario and how you can bend and twist your mapping metadata instead of changing your application or database schema.

We also show you how you can override the SQL Hibernate generates automatically. This includes SQL queries, DML (create, update, delete) operations, as well as Hibernate's automatic DDL-generation feature. You'll see how to map stored procedures and user-defined SQL functions, and how to apply the right integrity rules in your database schema. This ...

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.