SSH Framework integration encountered error--hibernate query statement error

Source: Internet
Author: User

In the debug foreground registration interface, fill in the registration information, the user name Ajax asynchronous verification times error, error file in the DAO file query statement.

Error message:

Java.lang.illegalargumentexception:org.hibernate.queryexception:legacy-style query parameters ('? ') is no longer Supported; Use Jpa-style ordinal parameters (e.g., '? 1 ') Instead:from com.itcast.shop.user.vo.User where username =? [from com.itcast.shop.user.vo.User where username =?]
At Org.hibernate.internal.ExceptionConverterImpl.convert (exceptionconverterimpl.java:133)
At Org.hibernate.internal.ExceptionConverterImpl.convert (exceptionconverterimpl.java:157)
At Org.hibernate.internal.ExceptionConverterImpl.convert (exceptionconverterimpl.java:164)
At Org.hibernate.internal.AbstractSharedSessionContract.createQuery (abstractsharedsessioncontract.java:713)
At Org.hibernate.internal.AbstractSharedSessionContract.createQuery (abstractsharedsessioncontract.java:103)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

Reason for error: The Find method is obsolete, causing the HQL statement format to be changed before it can be used.

The "?" in the HQL statement Change to Jpa-style:

String hql= "from User where username =? 0";

This makes it possible to query the information correctly.

SSH Framework integration encountered error--hibernate query statement error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.