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
  1. 0

    Colons in SQL queries in Hibernate

    Stack Overflow | 1 year ago | Tiny
    javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.QueryException: Space is not allowed after parameter prefix ':' [select rownum from (select @rownum:=@rownum+1 as rownum, tbl.country_id from country tbl, (select @rownum:=0)t order by tbl.country_id desc)t where country_id=?]
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Colons in SQL queries in Hibernate

    Stack Overflow | 1 year ago | Tiny
    javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.QueryException: Space is not allowed after parameter prefix ':' [select rownum from (select @rownum:=@rownum+1 as rownum, tbl.country_id from country tbl, (select @rownum:=0)t order by tbl.country_id desc)t where country_id=?]
  4. 0

    hibernate + mysql + load data in file

    Stack Overflow | 5 years ago | user732362
    org.hibernate.QueryException: Space is not allowed after parameter prefix ':' [LOAD DATA INFILE E:/uploaded/NumSerie/NS/NumSerie.txt INTO TABLE prod CHARACTER SET latin1 FIELDS TERMINATED BY ';' LINES TERMINATED BY ' ' IGNORE 1 LINES;]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    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