Skip to Main Content
Hibernate: A Developer's Notebook
book

Hibernate: A Developer's Notebook

by James Elliott
May 2004
Intermediate to advanced content levelIntermediate to advanced
192 pages
4h 46m
English
O'Reilly Media, Inc.
Content preview from Hibernate: A Developer's Notebook

5. Richer Associations

Yes, wealthy friends would be nice. But I can't propose an easy way to get any, so let's look at relationships between objects that carry more information than simple grouping. In this chapter we'll look at the tracks that make up an album. We had put that off in Chapter 4 because organizing an album involves more than simply grouping some tracks; you also need to know the order in which the tracks occur, as well as things like which disc they're on, in order to support multi-disc albums. That goes beyond what you can achieve with an automatically generated join table, so we'll design our own AlbumTrack object and table, and let albums link to these.

Before diving in, there's an important concept called "laziness" we need to explore.

In this chapter:

  • Using Lazy Associations

  • Ordered Collections

  • Augmenting Associations in Collections

  • Lifecycle Associations

  • Reflexive Associations

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Getting Started with Hibernate 3

Getting Started with Hibernate 3

James Elliott

Publisher Resources

ISBN: 0596006969Supplemental ContentCatalog PageErrata