-->
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: using strings in named query
PostPosted: Fri Dec 05, 2008 4:59 pm 
Newbie

Joined: Fri Dec 05, 2008 4:55 pm
Posts: 1
I'd like to use some strings in a named query.

[code]
<query name="tradeloader.getPositions">from Position where cusip= :cusip and dealernumber= :dealernumber</query>
[/code]
This works.

I'd like to add accountsource='DST' or accountsource='TDA'

How can I do this with the named query?
I tried this, but no good:

[code]
<query name="tradeloader.getPositions">from Position where cusip= :cusip and dealernumber= :dealernumber accountsource='TDA'</query>
[/code]

Even if I lose the single quotes still no good.
Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2008 5:25 pm 
Regular
Regular

Joined: Mon Apr 19, 2004 6:54 pm
Posts: 79
You can try this:
Code:
<query name="tradeloader.getPositions"><![CDATA[
from Position where cusip= :cusip and dealernumber= :dealernumber and accountsource='TDA'
]]></query>


Christophe


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.