in where clause expressions one should use property names, not column names? am i right? then why query "byUserUID" in this mapping does not work? it throws "unknown column userUID"... i'm using hibernate 2.1.6
Code:
<hibernate-mapping
>
<class
name="pl.iteam.nos.service.notification.model.Subscription"
table="notification_Subscription"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
optimistic-lock="version"
>
<id
name="id"
column="ID_Subscription"
type="java.lang.Long"
>
<generator class="native">
</generator>
</id>
<discriminator
column="type"
type="string"
length="1"
/>
<subclass
name="pl.iteam.nos.service.notification.model.GroupSubscription"
dynamic-update="false"
dynamic-insert="false"
discriminator-value="G"
>
<property
name="groupId"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="subscriberId"
/>
</subclass>
<subclass
name="pl.iteam.nos.service.notification.model.PersonalSubscription"
dynamic-update="false"
dynamic-insert="false"
discriminator-value="P"
>
<property
name="userUID"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="subscriberId"
/>
</subclass>
</class>
<query name="byUserUID"><![CDATA[
from PersonalSubscription where userUID = ?
]]></query>
</hibernate-mapping>