many-to-many looks like this
/**
* @hibernate.set table="link_table" lazy="false" cascade="none" readonly="true"
* @hibernate.collection-many-to-many class="com.sparrow.om.Foo" column="foo_id"
* @hibernate.collection-key column="bar_id"
* @return java.util.Set
*/
On 6 Feb 2004, at 17:23, Shishir K. Singh wrote:
I would say that have a look at the test suite that comes with the xdoclet src and look for the hibernate examples. I think that I saw something similar to what you need. I too had the same concerns but I decided to opt the easy way out (due to lack of time) by putting id in each of my assocition class (that joins the two many to many class).
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of kaxell Sent: Friday, February 06, 2004 10:47 AM To: [EMAIL PROTECTED] Subject: [Xdoclet-user] Many to many with Hibernate
Hi,
I'm using xdoclet to generate my hibernate mapping files but I have a
problem when I'm trying to generate a many to many relationship. I have
two tables which have a many to many relationship. They are linked to
eachother with a third table which also contains some extra properties
except the keys of the others. I have three separate classes and I'm
using a many-to-one relationship in the linking table to the other two
and from the two I'm using a one-to-many relationship. When I try to
generate the mapping files I get an exception which says that my linking
table is missing an id.
What I understand is that I haven't got it right in the xdoclet tags but
I don't know how to fix it. Does anyone have any suggestions or examples
how to solve this? The doclet is looking something like this:
/** * @hibernate.set * lazy="true" * inverse="true" * @hibernate.collection-key * column="colId" * @hibernate.collection-one-to-many * class="TheRelClass" * */
--------------
/** * @hibernate.many-to-one * column="colId" * class="TheManyClass" * */
Thanks in advance.
/K
------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
