MS SQL Exception: Incorrect syntax near '@P0'

前端 未结 7 659
孤街浪徒
孤街浪徒 2020-12-03 16:36

I\'m querying a DB using MS SQL and for some reason I get the following error: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near \'@P0\' ev

7条回答
  •  不知归路
    2020-12-03 17:03

    Upgraded hibernate to version 5.x and came across this issue. Had to update "hibernate.dialect" configuration from org.hibernate.dialect.SQLServerDialect to org.hibernate.dialect.SQLServer2012Dialect. Fixed the issue!

    Hibernate Doc Reference: https://docs.jboss.org/hibernate/orm/3.6/reference/en-US/html/session-configuration.html#configuration-programmatic

    Hibernate Jira issue: https://hibernate.atlassian.net/browse/HHH-10032

提交回复
热议问题