-->
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: JDBC Escape Sequences do not work
PostPosted: Sat Apr 17, 2004 6:00 am 
Newbie

Joined: Sat Apr 17, 2004 5:50 am
Posts: 1
JDBC Escape Sequences do not work in named native sql queries -

I tried to used JDBC Escape Sequences in a named SQL query, it appears that Hibernate assumes braces i.e '{' and '}' as Alias names and an exception is thrown.

This is the Query which tried using SQL Server dialect -

SELECT CategoryService.ServiceID as {SearchResults.ServiceID},
CategoryService.Name as {SearchResults.Title},
CategoryService.Description as {SearchResults.Summary},
CategoryService.DocumentID as {SearchResults.DocumentID}
FROM {oj DefArea LEFT OUTER JOIN DefService CategoryService
LEFT OUTER JOIN DefCategoryServices
LEFT OUTER JOIN DefCategory ON
DefCategoryServices.CategoryID = DefCategory.CategoryID ON
CategoryService.ServiceID = DefCategoryServices.ServiceID ON
DefArea.AreaID = CategoryService.AreaID}
WHERE (CategoryService.IsSpecialOrder = 0 or DefArea.HasSpecialOrder = 1) AND
(CategoryService.AreaID in (2, 1, 3)) AND
(CategoryService.IsInactive = 0) and
(({fn UCASE(DefCategory.Name)} LIKE {fn UCASE(:SearchString)}) OR
({fn UCASE(CategoryService.Name)} LIKE {fn UCASE(:SearchString)}) OR
({fn UCASE(CategoryService.Description)} LIKE {fn UCASE(:SearchString)}))

Kishore


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 17, 2004 6:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
YEs, I realized this recently. We need to fix that - submit it to JIRA.


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.