[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4907) "id in ..." with EmbeddedId and criteria API fails on ms sql server

Strong Liu (JIRA) noreply at atlassian.com
Mon Mar 1 10:50:47 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=35708#action_35708 ] 

Strong Liu commented on HHH-4907:
---------------------------------

not only ms sql server,

sybase:
Hibernate: 
    select
        this_.id as id782_0_,
        this_.version as version782_0_,
        this_.prop as prop782_0_ 
    from
        SomeEntity this_ 
    where
        (
            (
                this_.id, this_.version
            ) in (
                (
                    ?, ?
                ), (
                    ?, ?
                )
            )
        )
03:20:36,133 TRACE IntegerType:151 - binding '1' to parameter: 1
03:20:36,133 TRACE IntegerType:151 - binding '12' to parameter: 2
03:20:36,133 TRACE IntegerType:151 - binding '10' to parameter: 3
03:20:36,136 TRACE IntegerType:151 - binding '23' to parameter: 4
03:20:36,138  WARN JDBCExceptionReporter:100 - SQL Error: 156, SQLState: ZZZZZ
03:20:36,140 ERROR JDBCExceptionReporter:101 - Incorrect syntax near the keyword 'in'.


DB2:
Hibernate: 
    select
        this_.id as id811_0_,
        this_.version as version811_0_,
        this_.prop as prop811_0_ 
    from
        SomeEntity this_ 
    where
        (
            (
                this_.id, this_.version
            ) in (
                (
                    ?, ?
                ), (
                    ?, ?
                )
            )
        )
03:45:47,275 TRACE IntegerType:151 - binding '1' to parameter: 1
03:45:47,275 TRACE IntegerType:151 - binding '12' to parameter: 2
03:45:47,276 TRACE IntegerType:151 - binding '10' to parameter: 3
03:45:47,276 TRACE IntegerType:151 - binding '23' to parameter: 4
03:45:47,281  WARN JDBCExceptionReporter:100 - SQL Error: -104, SQLState: 42601
03:45:47,281 ERROR JDBCExceptionReporter:101 - DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=(;this_.version) in (;<values>, DRIVER=3.57.86
03:45:47,281  WARN JDBCExceptionReporter:100 - SQL Error: -727, SQLState: 56098
03:45:47,282 ERROR JDBCExceptionReporter:101 - DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098, SQLERRMC=2;-104;42601;(|this_.version) in (|<values>, DRIVER=3.57.86
03:45:47,282  WARN JDBCExceptionReporter:100 - SQL Error: -727, SQLState: 56098
03:45:47,282 ERROR JDBCExceptionReporter:101 - DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098, SQLERRMC=2;-104;42601;(|this_.version) in (|<values>, DRIVER=3.57.86
03:45:47,293  INFO SessionFactoryImpl:852 - closing
03:45:47,294  INFO SchemaExport:226 - Running hbm2ddl schema export



> "id in ..." with EmbeddedId and criteria API fails on ms sql server
> -------------------------------------------------------------------
>
>                 Key: HHH-4907
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4907
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.5.0-CR-1
>         Environment: ms sql server
>            Reporter: Strong Liu
>
> [http://hudson.qa.jboss.com/hudson/view/Hibernate%20Community/job/hibernate-core-trunk/database=mssql2005,jdk=java15_default,label=hibernate/lastCompletedBuild/testReport/org.hibernate.test.annotations.cid/CompositeIdTest/testQueryInAndComposite/ ]
> org.hibernate.exception.SQLGrammarException: could not execute query
> 	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
> 	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
> 	at org.hibernate.loader.Loader.doList(Loader.java:2276)
> 	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2151)
> 	at org.hibernate.loader.Loader.list(Loader.java:2146)
> 	at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
> 	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1706)
> 	at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
> 	at org.hibernate.test.annotations.cid.CompositeIdTest.testQueryInAndComposite(CompositeIdTest.java:306)
> Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near ','.
> 	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:156)
> 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1373)
> 	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:371)
> 	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:322)
> 	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4003)
> 	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1550)
> 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:160)
> 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:133)
> 	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:265)
> 	at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
> 	at org.hibernate.loader.Loader.getResultSet(Loader.java:1832)
> 	at org.hibernate.loader.Loader.doQuery(Loader.java:719)
> 	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:271)
> 	at org.hibernate.loader.Loader.doList(Loader.java:2273)
> 	... 32 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list