-->
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.  [ 6 posts ] 
Author Message
 Post subject: whats wrong with my query?
PostPosted: Wed Nov 30, 2005 8:05 pm 
Newbie

Joined: Wed Nov 30, 2005 7:58 pm
Posts: 3
List results = getHibernateTemplate().find("from Support obj where obj.attributeName = 'B PROT CLASS'");

using spring SupportDAO extending HibernateDaoSupport with Hibernate3
Problem: If I should get 10 Support object, they all are same objects. i.e. 10 copies of the first result. What am I doing wrong?

using eclipse for dev and postgres for database...

thank you,

Indu

---------------------------------------------------------------------------------
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 10:35 pm 
Newbie

Joined: Mon Sep 26, 2005 8:43 am
Posts: 16
Try following,

String attribName = "B PROT CLASS";
List results = getHibernateTemplate().find("from Support obj where obj.attributeName = ?",attribName);

And please rate it if you find the answer useful.

_________________
--Beejal


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 01, 2005 12:51 pm 
Newbie

Joined: Wed Nov 30, 2005 7:58 pm
Posts: 3
thank you Beejal for your reply...

still I get copies of the first result row. Just copies???!!!

But

select obj.attributeValueDescription from Support obj where obj.attributeName = 'B PROT CLASS'"

returns right results but an object with one column. I wish I don't have to type in 120 or so columns to get the whole row of data??!!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 01, 2005 1:49 pm 
Newbie

Joined: Thu Dec 01, 2005 1:02 pm
Posts: 5
Location: Nijmegen, Nederland (nl)
Does the Support class have descendants? In other words, is it a superclass for some classes like SupportMail, SupportCall etc?

I ask because it looks like you have a problem with inheritance mapping?

_________________
-Stijn

http://gx.nl
http://bergland-it.nl
http://dutch-politics.blogspot.com


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 01, 2005 1:56 pm 
Beginner
Beginner

Joined: Wed Nov 30, 2005 2:41 pm
Posts: 29
How are you accessing the results? Due to lazy evaluation, result isn't a real "List"... maybe turn off lazy evaluation & see if that helps.
______
Dwight
pls rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 01, 2005 4:14 pm 
Newbie

Joined: Wed Nov 30, 2005 7:58 pm
Posts: 3
this is the set up in the respective hbm mapping file

<class
name="com.domain.objectModel.Support"
table="asarrep"
lazy="false"
>

I hope that sets the lazy evaluation to false I guess. Still the same problem.

to Stijn: No, this class doesn't have a superclass or a subclass, I mean no parent class, no child class.

-Indu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.