Hey,
I have 2 tables CustomerOrder and CustomerOrderLines. When I run my select query a get the following fault:
net.sf.hibernate.QueryException: path expression ends in a composite value: customeror0_.id [SELECT co.customerNo, co.status, co.deliveryDate, col.orderLineNo, col.articleNo, col.articleName, col.price, FROM net.sf.hibernate.CustomerOrder co, net.sf.hibernate.CustomerOrderLine col WHERE co.id=col.id.countryCode AND co.id=col.id.customerOrderNo col.orderLineNo='181382']
What does Hibernate mean with
path expression ends in a composite value: customeror0_.id?
Mapping structure looks like this:
CustomerOrder
-----------------
Code:
<composite-id name="compOrderLineID" class="net.sf.hibernate.CompositeCustOrdLinesID">
<key-property name="customerOrderNo" column="CUSTOMERORDERNO" type="string"/>
<key-property name="countryCode" column="COUNTRYCODE" type="string"/>
</composite-id>
<property name="deliveryDate" column="DELIVERYDATE"/>
<property name="price" column="PRICE"/>
<property name="freightCost" column="FREIGHTCOST"/>
<property name="status" column="STATUS"/>
<property name="paymentMode" column="PAYMENTMODE"/>
<property name="totalVolume" column="TOTALVOLUME"/>
<property name="totalWeight" column="TOTALWEIGHT"/>
<property name="totalCost" column="TOTALCOST"/>
<property name="versionNo" column="VERSIONNO"/>
</class>
CustomerOrderLine
----------------------
Code:
<class name="net.sf.hibernate.CustomerOrderLine" table="CUSTOMERORDERLINE_T">
<composite-id name="compOrderLineID" class="net.sf.hibernate.CompositeCustOrdLinesID">
<key-many-to-one name="customerOrderNo" class="net.sf.hibernate.CustomerOrder">
<column name="countryCode"/>
<column name="customerOrderNo"/>
</key-many-to-one>
<key-property name="orderLineNo" column="ORDERLINENO" type="string"/>
</composite-id>
<property name="articleNo" column="ARTICLENO"/>
<property name="articleName" column="ARTICLENAME"/>
<property name="quantity" column="QUANTITY"/>
<property name="price" column="PRICE"/>
<property name="volume" column="VOLUME"/>
<property name="weight" column="WEGHT"/>
<property name="deliveryDate" column="DELIVERYDATE"/>
</class>
Best Regards
Johan