Hibernate version: 3.0.5
Mapping documents:
Code:
<class
name="com.pnetx.ecomm.domain.Product"
table="Product"
>
...
<property name="price" type="com.pnetx.util.types.MoneyType">
<column
name="priceAmount"
length="8"
precision="2"
not-null="true"
/>
<column
name="priceCurrency"
length="3"
not-null="true"
/>
</property>
Given a Product class with:
Code:
public Money getPrice() ...
A Money class with:
Code:
public BigDecimal getAmount() ...
public Currency getCurrency() ...
and a corresponding MoneyType that implements UserType, then why does the following HQL query:
Code:
from Product p where ? = p.price.amount
give the following exception:
Code:
org.hibernate.QueryException: could not resolve property: amount of: com.pnetx.ecomm.domain.Product
?
How else can I select all products having a given price amount?
Thanks.