Hi I have some problem with hibernate views.My database is mysql5.0. I have one table "students". The corresponding DTO is "Student". I have mapped this DTO in the hbm file to the students table. The following is the mapping file
Code:
<class name="Student" table="students">
<cache usage="read-only"/>
<id name="id" column="student_id" type="string" unsaved-value="null">
<generator class="generated" />
</id>
<property name="name" />
<property name="address" />
</class>
In addition to this there is a named query which usses name and address.
now I have created a view on table "students". The view name is "rstudents". it contains only 2 columns "count" and "student_ID".
now i have created a DTO "RStudent" which extends "Student" and created the following hbm file
Code:
<class name="RStudent" table="rstudents">
<cache usage="read-only"/>
<id name="id" column="student_id" type="string" unsaved-value="null">
<generator class="assigned" />
</id>
<property name="count" />
</class>
with this setup i am getting an error that says "Exception in the named queries(named quires in the first hbm) ". if i remove the view hbm, everything is working fine. any ideas what actually is happening? and how to resolve this?