hey all,
i have these two mapping XML`s for Inventory and ProductInformation tables respectively:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="tpos.Inventory" table="inventory">
<id name="allocationId" type="int" column="AllocationId" >
<generator class="native"/>
</id>
<property name="allocatedLocation">
<column name="AllocatedLocation"/>
</property>
<property name="sellable_Notsellable">
<column name="Sellable_NotSellable"/>
</property>
<property name="sellablefromDate">
<column name="SellableFromDate" />
</property>
<property name="sellableTill">
<column name="SellableTill" />
</property>
<many-to-one name="productID" class="tpos.ProductInformation" column="productid" not-null="false" cascade="all" unique="true" />
</class>
</hibernate-mapping>
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="tpos.ProductInformation" table="ProductInformation" >
<id name="productId" type="int" column="ProductId" >
<generator class="native"/>
</id>
<property name="productCode">
<column name="ProductCode"/>
</property>
<property name="productName">
<column name="ProductName" />
</property>
<property name="createdDate">
<column name="CreatedDate"/>
</property>
<property name="expiryDate">
<column name="ExpiryDate" />
</property>
<property name="statuS">
<column name="Status" />
</property>
<property name="sellablE">
<column name="Sellable" />
</property>
<property name="purchaseDate">
<column name="PurchaseDate" />
</property>
<property name="barcodeNo">
<column name="BarcodeNo" />
</property>
<property name="updationDate">
<column name="UpdationDate" />
</property>
<property name="createdBy">
<column name="CreatedBy" />
</property>
<property name="updatedBy">
<column name="UpdatedBy" />
</property>
<property name="productCompType">
<column name="ProductCompType" />
</property>
</class>
</hibernate-mapping>
Now, i want to call a join statement on both of them using HQL..... so i defined a relationship in inventory XML and called this query
select pi.productCode , pi.productName , pi.barcodeNo , inv.saleunitprice , inv.quantity from Inventory inv join inv.ProductInformation pi
but it always fails with this error:
could not resolve property:ProductInformation of: tpos.Inventory
Can you guys please help me this?