Since my initial post has not generated any responses,
let me try asking this question another way:
How would experienced users map the following:
we are creating new templates that contain a reference to existing
preferences and an 'override' for a preference value.
The preferences all exist and we will not be dynamically
adding new preference or trying to managing the templates
that include a certain preference (not really bi-directional?)
I think the preference_value in the xref table
throws kink in the normal many-to-many join table concept
because of the extra field.
Can a mapping be setup such that when we create a new
template, with a set of new templatePrefXref objects
that we can make one call to hibernate ( object.create() )
to have the new template row inserted and the new associated
template_pref_xref rows inserted as well?
Currently we have to create the template with an empty set,
then iterate thru a set of templatePrefXref objects updating
those with the correct new template_id, put the set back
into the template object and call object.store().
Code:
|--------------| |----------------------| |--------------|
| template | | template_pref_xref | | preference |
|--------------| |----------------------| |--------------|
| template_id | <--> | template_id | <--> | preference_id|
| (other cols) | | preference_id | | (other cols) |
| | | preference_value | | |
|--------------| | | |--------------|
|----------------------|
[/code]