Hi,
In a dating application I have a class: Subscriber and I need to reference favourite (other) Subscribers in the system for a particular Subscriber. It seems most logical to self reference the class object in a many to many way.
I use the following xdoclet code in my Subscriber class:
Code:
@hibernate.set name="bookmarks" table="Bookmarks" cascade="save-update" inverse="true" lazy="true" order-by="UserName asc"
@hibernate.collection-key column="SubscriberID"
@hibernate.collection-many-to-many class="packagename.business.entities.Subscriber"
column="SubscriberID"
I'm getting a
Code:
net.sf.hibernate.MappingException: duplicate mapping for property: packagename.business.entities.Subscriber
, when I try to generate the database from the ant task. Presumably it doesn't work using regular Hibernate either. You would want to specify some alias name.
If somebody can offer advice, thanks!
Marc