wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes escaping SQL keywords in hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "escaping SQL keywords in hibernate" Watch "escaping SQL keywords in hibernate" New topic
Author

escaping SQL keywords in hibernate

Chandra shekar M
Ranch Hand

Joined: Dec 20, 2006
Posts: 135
Hi

I have a hibernate foruma like this.
<formula>
(select listagg(size,',') WITHIN group (order by size) from (select distinct(size) from a where id = 10 ))
</formula>

Hibernate is not identify WITHIN as keyword instead it prefixs it with table a alias to avoid this i wrote it like
<formula>
(select listagg(size,',') 'WITHIN' group (order by size) from (select distinct(size) from a where id = 10 ))
</formula>

Hibernate will not prefix the table alias instead it will be 'WITHIN' in the final query and SQL fails saying missing WITHIN keyword. How to pass WITHIN
to final sql?

Thanks
Chandra
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: escaping SQL keywords in hibernate
 
Similar Threads
stuck up in the problem
Error compiling EJB-QL statement ''; FROM not found
Hibernate: Different Join in Save() and Get()
How to map column to a property ?
hibernate mapping to subclass