-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: problem with view in hibernate?
PostPosted: Tue Aug 17, 2010 3:43 pm 
Newbie

Joined: Tue Aug 17, 2010 3:29 pm
Posts: 12
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?


Top
 Profile  
 
 Post subject: Re: problem with view in hibernate?
PostPosted: Wed Aug 18, 2010 2:18 pm 
Newbie

Joined: Tue Aug 17, 2010 3:29 pm
Posts: 12
do any one have an idea on this? please help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.