I can't succeed in creating a simple mapping between two tables (order_item/product_catalog)
My Product is mapped as follow:
<hibernate-mapping package="com.xxx.bean">
<class name="ProductBean" table="TEST_product">
<id type="long">
<generator class="native"/>
</id>
<property name="code" column="CODE" not-null="true" access="field" unique="true"/>
<property name="type" column="TYPE" not-null="true" access="field" unique="false"/>
<property name="category" column="CATEGORY" not-null="true" access="field" unique="false"/>
<property name="min_qty" column="MIN_QTY" not-null="false" access="field" unique="false"/>
<property name="label" column="LABEL" not-null="false" access="field" unique="false"/>
</class>
</hibernate-mapping>
My ContractedProduct is mapped as follow:
<hibernate-mapping package="com.xxx.bean">
<class name="ContractedProductBean" table="TEST_contracted_product">
<id type="long">
<generator class="native"/>
</id>
<many-to-one name="product_ref_id" column="PRODUCT_REF_ID"/>
<property name="code" column="CODE" not-null="true" access="field" unique="true"/>
<property name="quantity" column="QUANTITY" not-null="false" access="field" unique="false"/>
</class>
</hibernate-mapping>
and my java classes have properties (id, and product_ref_id) declared as long (NOT java.lang.Long). I have also tried java.lang.Long but same result !!! argggg
Any ideas??? thanks a LOT!
jbg
when loading mappings, hibernate generates the following error:
net.sf.hibernate.MappingException: An association from the table TEST_contracted_product refers to an unmapped class: long
at net.sf.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:643)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:743)
at com.netonomy.bl.BLSession.<init>(BLSession.java:90)
at com.netonomy.generator.GenDB.populateDB(GenDB.java:76)
at com.netonomy.generator.GenDB.main(GenDB.java:45)
|