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

Hibernate JIRA | Alexey Romanchuk | 6 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards 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