O'Reilly logo

Implementing Domain-Driven Design by Vaughn Vernon

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

ORM and Many Values Backed by a Join Table

Hibernate provides a means to persist multivalued collections in a join table without requiring the Value type itself to have any data model entity characteristics. This mapping type simply persists the collection Value elements to a dedicated table with the parent Entity domain object’s database identity as a foreign key. Thus, all collection Value elements can be queried by their parent’s foreign key identity and reconstituted into the model’s Value collection. The strength of this mapping approach is that the Value type doesn’t need to have a hidden surrogate identity in order to achieve a join. To use this Value collection mapping option you employ Hibernate’s <composite-element> tag.

This seems ...

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