Hi,
I've created a UserType for the replicationOperation property of one of my mapped classes (ReplicationAudit). The relevant part of the mapping file is shown below:
Code:
<class name="ReplicationAudit" table="REPLICATION_AUDIT">
<property name="replicationOperation" column="REPLICATION_OPERATION_ID" type="com.example.replication.model.personalization.ReplicationOperationUserType" not-null="true" />
</class>
The UserType has a name property, but when I try to order by this property I get an exception containing the following message
Quote:
could not resolve property: name of: com.example.replication.model.personalization.ReplicationAudit
I've tried writing the query in two ways:
Code:
"from ReplicationAudit ra " +
"where ra.id > :afterId " +
"and ra.id <= :uptoId " +
"order by ra.replicationOperation.name asc"
and:
Code:
"from ReplicationAudit ra " +
"inner join ra.replicationOperation as raOp " +
"where ra.id > :afterId " +
"and ra.id <= :uptoId " +
"order by raOp.name asc"
But the result is the same in both cases. From the error message, it seems like Hibernate is trying to order by ReplicationAudit.name, rather than ReplicationAudit.replicationOperation.name.
Thanks in Advance,
DM