Just looking thro the table of contents of the EJB3 Persistence book, I couldn't tell whether it covers many-to-many join tables, or other more complicated entity relationships.
I have worked with legacy databases on the last 2 projects I did, and with Hibernate I had a few problems mapping the tables to a reasonable domain model. For example, I effectively had a one-to-one relationship to model, but in the DB it was a parent-child entity relationship, and I had to map a left-join from the child to the parent. Hibernate couldn't do it.
How much would you say EJB3 provides for doing this sort of thing?
I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
posted 9 years ago
The book does discuss the more advanced mappings in the spec, although many-to-many join tables are not considered advanced but are in chapter 4, which is the basic O/R mapping chapter.
The first version of the spec covers some of the more common mappings, and also some exotic ones, but admittedly there will be some that are not fully specified. Some aspects of parent-child relationships are available through cascading. Explicit queries support left joins, but the spec does not specify exactly how a vendor must query for related objects if joining is not requested or for internal object loading. This would currently be a feature in vendor-add land.