-->
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: Hibernate remove empty spaces to single space in sql-query
PostPosted: Fri Jun 03, 2005 9:11 am 
Newbie

Joined: Fri Jun 03, 2005 8:59 am
Posts: 1
I have defined this query string in filename.hbm.xml

<sql-query name="findByMember">
<return alias="member" class="com.module.vo.MemberVo" />
<![CDATA[
select M.member_nbr as {member.member_nbr} , M.name_last as {member.name_last}
from member M
LEFT OUTER JOIN address A
ON CONCAT('D M ', M.member_nbr) = A.addrtype_who
WHERE M.name_first LIKE :name_first AND M.name_last LIKE :name_last
ORDER BY M.name_last, M.name_first

]]>
</sql-query>

When the query print in the console, I have 3 empty spaces between D and M "CONCAT('D M ', M.member_nbr)" when I do the concatanation but it trim the space to only one space. My query doesn't return the correct data due to the trim of the empty space.


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.