Chapter 24Creating Advanced Mappings and Custom Data Types

  • Why convert nonstandard data types?
  • How to embed POJOs inside entities
  • How to define relationships between entities
  • Using revisions and timestamps to version entities
  • How to define common entity ancestors
  • How to map Collections and Maps of basic and embedded values
  • Using multiple tables to store entities
  • Constructing programmatic triggers
  • Using load time weaving to lazy load simple properties

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER

You can find the wrox.com code downloads for this chapter at http://www.wrox.com/go/projavaforwebapps on the Download Code tab. The code for this chapter is divided into the following major examples:

  • Advanced-Mappings Project
  • Customer-Support-v18 Project

NEW MAVEN DEPENDENCIES FOR THIS CHAPTER

There are no new Maven dependencies for this chapter. Continue to use the Maven dependencies introduced in all previous chapters.

WHAT’S LEFT?

So far you’ve done some cool things with JPA. From simple lookups to complex queries to advanced searching, you’ve thoroughly explored the Java Persistence API and its CRUD capabilities.

So what’s left? Well, you’ve only touched the surface on the ways you can map objects to database tables. So far your entities have been very straightforward, containing only basic types that the JPA provider can directly and unambiguously convert to and from relational database field types. In reality, your entities will not be so trivial. You have already ...

Get Professional Java for Web Applications 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.