ITeye博客

[Hibernate 3] bug about string "call"

SilverRing · 2009-09-01 18:56 · Hibernate · Java · Hibernate · OpenSource · Markdown

Once there's a string "call" involved in an hql, hibernate will throw an exception like the one below:

HibernateSystemException: ordinal parameter mismatch

This is an open bug reported here:

http://opensource.atlassian.com/projects/hibernate/browse/HHH-1423

A simple workaround is to make the 'call' variable the first in the query

before:


from Ship s where s.name = ? and s.callsign = ?

after


 from Ship s where s.callsign = ? and s.name = ?

评论(1)

  1. #1 楼 · weifly · 2009-09-14 15:02

    这样写也会有bug: from Ship s where s.name ='call' 改为参数形式就没问题了: from Ship s where s.name=?

评论功能维护中,当前仅展示历史评论。