From: Marco P. <mar...@cm...> - 2002-04-16 07:59:58
|
I have problems understanding, the operations/settings nesecary for the following example... A client can place multiple orders, a order consists out of multiple orderlines, and an orderline contains a product. I am starting with a simple example that a client just can place multiple orders... a order can only refer to 1 client so a one-to-many relationship.... I tried to use the following mapping.. ----------------------- <?xml version="1.0"?> <!DOCTYPE hibernate-mapping SYSTEM "hibernate-mapping.dtd"> <hibernate-mapping> <class name="com.mticket.Client" table="Client"> <id name="clientId" type="long"> <generator class="cirrus.hibernate.id.HiLoGenerator"/> </id> <property name="name"/> <set role="besteld" table="order"> <key column="Id" type="long"/> <one-to-many class="com.mticket.Order"/> </set> </class> <class name="com.mticket.Order" table="order"> <id name="orderid" type="long"> <generator class="cirrus.hibernate.id.HiLoGenerator"/> </id> <property name="description"/> <many-to-one name="Client" column="clientId" class="com.mticket.Client"/> </class> </hibernate-mapping> ----------------------- I am nut sure about the <many-to-one tags and the role.... Can someone help me out? Greetings.. Marco |