I'm using a create SQL query that maps to a class with composite primary keys mapping to a oracle 9i database. I need it to call a max function on a particular column that's one of the composite ids.
I keep getting the error net.sf.hibernate.QueryException: No column name found for property [partyId] though my find functions work great and it doesn't give a error on the regular property elements. Is there a way to map to composite ids using this call?
ex:
createSQLQuery("select {pad}.test as {pad.test}, max({pad}.prty_id) as {pad.partyId} " +
"from MYTABLE {pad}",
"pad", MyClass.class)
mapping ex:
<class name="MyClass" table="MYTABLE">
<composite-id name="pk" class="MyPrimaryKey">
<key-property name="partyId" column="PRTY_ID" type="java.math.BigDecimal" />
</composite-id>
<property name="test" column="modified_by" />
</class>
|