From a design standpoint, I wonder which would be the best solution,
having a join table or simply letting FKs add up as columns on the D
table. Join tables sounds more elegant, a single table sounds way
easier to implement/maintain, hm.
On Jun 4, 11:12 am, Jason Sznol jasonsz...@gmail.com
I don't want to start a new topic regarding this but I was able to fix
my problem. By putting a HasAndBelongsToMany Attribute on my three
entities owning the last entity, I was able to force ActiveRecord and
hbm2ddl to use a join table so the schema looks like this
(ParentEntityTable x
I have three unique entity classes that each have a collection of a
fourth entity via the HasMany attribute. The mappings should be one-to-
many unidirectional relationships from entities A, B, and C to entity
D. Each HasMany attribute references the same table and the same
column for the foreign
I apologize I worded my first message improperly. D should have no
knowledge
of the Entities A, B or C. In my object there is no Property for
linking back to
any one of the other entities. So it is a one sided HasMany with no
related BelongsTo.
I suppose an Any tag would work well in this
It might work with an explicit Any-Property in D. You must never
forget that even unidirectional relations are relations. And on the
database, one-to-many relations are implemented with FKs on the
one-side, regardless of whether AR hides that from the model or not.
-Markus
2009/5/27 Hexedit