Re: Multiple HasMany Relationships to a Single Entity (Schema Generation)

2009-06-05 Thread Thi
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

Re: Multiple HasMany Relationships to a Single Entity (Schema Generation)

2009-06-04 Thread Jason Sznol
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

Multiple HasMany Relationships to a Single Entity (Schema Generation)

2009-05-27 Thread Hexedit
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

Re: Multiple HasMany Relationships to a Single Entity (Schema Generation)

2009-05-27 Thread Hexedit
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

Re: Multiple HasMany Relationships to a Single Entity (Schema Generation)

2009-05-27 Thread Markus Zywitza
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