-->
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: using named queries defined in hbm file with single values a
PostPosted: Fri Oct 02, 2015 2:16 pm 
Newbie

Joined: Tue Aug 03, 2004 6:51 pm
Posts: 3
Location: Lafayette, Ca
say I have a named query defined in an hbm file that looks like this
Assume that the relationships are all correct

<query name="person.by.dateOfBirth.ebizRole">from Person as person join person.ebizAccountSet
as ebizAccount join ebizAccount.ebizAccountRoleSet ebizAccountRole
where ebizAccountRole.ebizRoleId=?
and person.birthDate = ?
and ebizAccount.accountId=?
</query>

I call the query like this'
params =objArray
(List<Object>) getHibernateTemplate().findByNamedQuery(
getQueryName(), params);

assume the right query name is returned:
and the parameters are all strings, the last being returned as "id1,id2,id3,id4"

Object[] objArray = { getEbizRole(), getBirthDate(), getGuids().toString().substring(1,getGuids().toString().length()-1)};

with replace meant it would be
Object[] objArray = { "role1", "2015-01-01", "id1,id2,id3,id4")};

should this work?
I get no error, but, no result.


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.