org.hibernate.QueryException: Space is not allowed after parameter prefix ':' 'select * from a where a.b = 'asdf \' asdf''

Hibernate JIRA | Alexey Romanchuk | 7 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.

    Root Cause Analysis

    1. 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()
    2. Hibernate
      SessionImpl.createSQLQuery
      1. org.hibernate.engine.query.ParameterParser.parse(ParameterParser.java:92)
      2. org.hibernate.engine.query.ParamLocationRecognizer.parseLocations(ParamLocationRecognizer.java:75)
      3. org.hibernate.engine.query.QueryPlanCache.buildNativeSQLParameterMetadata(QueryPlanCache.java:149)
      4. org.hibernate.engine.query.QueryPlanCache.getSQLParameterMetadata(QueryPlanCache.java:79)
      5. org.hibernate.impl.AbstractSessionImpl.createSQLQuery(AbstractSessionImpl.java:146)
      6. org.hibernate.impl.SessionImpl.createSQLQuery(SessionImpl.java:1656)
      6 frames