-->
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.  [ 1 post ] 
Author Message
 Post subject: component in hql
PostPosted: Mon Mar 14, 2005 4:28 am 
Beginner
Beginner

Joined: Thu Jan 20, 2005 3:25 pm
Posts: 22
I'm not sure to understand exactly how components mappings work with hql:
I had a hql query like
Quote:
"select cp.codePays from CategoriePort cp where cp.pays = :pays"

cp.pays is here a component Pays with one simple String field.
and I tried
Code:
queryObject.setParameter("pays", otherPays);

where otherPays is another object of type Pays.

To get that working I had to do:
Code:
queryObject.setString("pays", otherPays.getPays());


By looking at the debug logs, the strange thing here is that hibernate serializes the object for parameter in the query (which of course fails)... Why isn't hibernate using the component info in the query?

Henri.


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

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.