Hello,
RAPHEAD wrote: > > Hi again, > > I now tried to play around with n:m mappings but had no luck > unfortunately. > This posting > (http://www.nabble.com/Many-To-Many-Relations-with-Hibernate-cartridge-td10250172s17564.html#a10371308) > suggests actually that exaclty what I expect can be generated but I dont > get it generated at all. > > I modelled a simple n:m relation between two classes USER and PROJECT. The > relation is bidirectional and has multiplicity * on both ends. I get these > mappings concerning relations: > > <set access="property" inverse="true" name="user"> > <key> > <column name="PROJECT_TO_USER_ITEM_ID" not-null="false" /> > </key> > <many-to-many class="de.User"> > <column name="PROJECT_TO_USER" not-null="false" /> > </many-to-many> > </set> > > > <set access="property" inverse="true" name="project"> > <key> > <column name="PROJECT_TO_USER_ITEM_ID" not-null="false" /> > </key> > <many-to-many class="de.Project"> > <column name="PROJECT_TO_USER" not-null="false" /> > </many-to-many> > </set> > > What is missing is the mapping for the relation table, something like > <set access="property" inverse="true" name="project" table="xxx"> > ... > > Am I missing something? > The table name is an optional attribute and is not set by the Hibernate Cartridge. In older versions this attribute was generated, but now the Hibernate default (property name) will be used. If there is a need to set this property, I could add a “collection_table” Tagged Value for <<Field>>. RAPHEAD wrote: > > If I create two 1:n relations between these classes, then I end up with > naming collisions > for relation columns. I think it is not covered by the cartridge yet -- > right? > In this case you have to set the columnName of, at least one association (or better <<EntityRelation>>). Thank you very much for you comments, Darius -- View this message in context: http://www.nabble.com/Problems-with-N%3AM-Mappings-in-HB-Cartridge-tp14649327s17564p14660379.html Sent from the Fornax-Platform mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Fornax-developer mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fornax-developer
