Hi,
Tricky ;) What about Hibernate Releational Model, how can we make it show some relation.
And one more think:
I have made an Event and a Person Entity as described in Hibernate tourial. Person have set of events and event has participants. The "Hibernate Entity Model" shows the entities but there is no line for displaying the relations.
Here are mappings:
Code:
<hibernate-mapping>
<class name="sample.Person" table="PERSON">
<id name="id" column="PERSON_ID">
<generator class="increment"/>
</id>
<property name="age"/>
<property name="firstname"/>
<set name="events" table="Person_Event">
<key column="Person_ID"></key>
<many-to-many column="EVENT_ID" class="sample.Event"/>
<many-to-many column="EVENT_ID" class="sample"></many-to-many>
</set>
</class>
</hibernate-mapping>
Code:
<hibernate-mapping>
<class name="sample.Event" table="EVENTS">
<id name="id" column="EVENT_ID">
<generator class="increment"/>
</id>
<property name="date" type="timestamp" column="EVENT_DATE"/>
<property name="title"/>
<set name="participants" table="Person_Event" inverse="true">
<key column="EVENT_ID"></key>
<many-to-many column="PERSON_ID" class="sample.Person"/>
</set>
</class>
</hibernate-mapping>
Any comments!
Regards,
Alireza Fattahi