[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5539?page=c...
]
Gail Badner commented on HHH-5539:
----------------------------------
I believe the problem is that Hibernate interprets ':' in a query as the start of
a placeholder for a paramter.
Please try escaping ':' as in "select * from a where a.b = 'asdf \'
asdf\: '" .
ParameterParser does not support escaped ' symbols
--------------------------------------------------
Key: HHH-5539
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5539
Project: Hibernate Core
Issue Type: Bug
Components: query-sql
Affects Versions: 3.6.0.Beta4
Environment: 3.6.0 and postgresql 8.2.1
Reporter: Alexey Romanchuk
Original Estimate: 2h
Remaining Estimate: 2h
I create native SQLQuery with createSQLQuery method.
Looks like ParameterParser incorrectly process queries with escaped ' symbol. For
example query like "select * from a where a.b = 'asdf \' asdf'"
works fine, but "select * from a where a.b = 'asdf \' asdf: '" fails
with
org.hibernate.QueryException: Space is not allowed after parameter prefix ':'
'select * from a where a.b = 'asdf \' asdf''
at org.hibernate.engine.query.ParameterParser.parse(ParameterParser.java:92)
at
org.hibernate.engine.query.ParamLocationRecognizer.parseLocations(ParamLocationRecognizer.java:75)
at
org.hibernate.engine.query.QueryPlanCache.buildNativeSQLParameterMetadata(QueryPlanCache.java:149)
at
org.hibernate.engine.query.QueryPlanCache.getSQLParameterMetadata(QueryPlanCache.java:79)
at org.hibernate.impl.AbstractSessionImpl.createSQLQuery(AbstractSessionImpl.java:146)
at org.hibernate.impl.SessionImpl.createSQLQuery(SessionImpl.java:1656)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira