-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate only return a result when must return a lot
PostPosted: Wed Oct 13, 2004 7:37 am 
Newbie

Joined: Fri Sep 17, 2004 1:05 pm
Posts: 10
I have this mapping association set

<set name="historyc" cascade="all" inverse="true" lazy="true">
<key column="C536870921"/>
<many-to-many class="helpdesk.IncidenceHistoryc"/>
</set>

and the hibernate query is

select historyc0_.C536870921 as C536870921__, historyc0_.C536870921 as C5368709210_, historyc0_.C536870916 as C5368709160_, historyc0_.C3 as C30_, historyc0_.C2 as C20_, historyc0_.C536870915 as C5368709150_, historyc0_.C536870913 as C5368709130_ from REGISTRO_HISTORICO_INCIDENCIA historyc0_ where historyc0_.C536870921=?

If I execute the query in the database works perfectly but hibernate is unable to do it well

What is the problem??


Top
 Profile  
 
 Post subject: the method with the query
PostPosted: Wed Oct 13, 2004 9:33 am 
Newbie

Joined: Fri Sep 17, 2004 1:05 pm
Posts: 10
protected List objectsById (String object, String id) throws DAOException {
List results = null;
Criteria c = null;
try{

Session session = HibernateSession.currentSession();
Query byId = session.createQuery("from "+object+" h where h.id like :id");

byId.setString("id", "id);

results = byId.list();



return results;

}catch(HibernateException he){
throw new DAOException(he);
}
}

some people have a idea about the problem??
I'm sure that the problem is a bad use of hibernate but I don't know where I'm wrong


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 13, 2004 1:21 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
what about showingthe 2 complete mapping files? you may have a wrong id declaration

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject: Thanks the problem had been fixed
PostPosted: Thu Oct 14, 2004 2:06 am 
Newbie

Joined: Fri Sep 17, 2004 1:05 pm
Posts: 10
The mapping was wrong, thanks for the idea about the possible error


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