[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4907?page=c...
]
Strong Liu resolved HHH-4907.
-----------------------------
Resolution: Fixed
Fix Version/s: 3.5.0.Next
AFAIK, only Oracle supports this syntax, so I only enable oracle dialect to void this
translation
{code}
+ /**
+ * HHH-4907, I don't know if oracle 8 supports this syntax, so I'd think it is
better add this
+ * method here. Reopen this issue if you found/know 8 supports it.
+ */
+ public boolean supportsRowValueConstructorSyntaxInInList() {
+ return true;
+ }
{code}
and there is one thing that should be noted:
if a dialect supports this syntax, (for now, only oracle), then the following hql will
cause *parse exception*
{quote}
from SomeEntity e where e.id in ( (1,12), (10,23), (10,22)), which e.id is a composite
id.
{quote}
but for another dialects, this fix can translates this hql to something like:
{quote}
where (e.id.a = 1 and e.id.b = 12) or (e.id.a=10 and e.id.b = 23) or (e.id.a=10 and
e.id.b=22)
{quote}
so Parameter query is a better choice in this situation i'd think
Support for tuple syntax in HQL/Criteria on databases which do not
support tuple syntax
---------------------------------------------------------------------------------------
Key: HHH-4907
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4907
Project: Hibernate Core
Issue Type: Improvement
Components: core
Affects Versions: 3.5.0-CR-1
Environment: ms sql server, sybase, db2
Reporter: Strong Liu
Assignee: Strong Liu
Fix For: 3.5.0.Next
Attachments: hhh-4907-2.patch, hhh-4907-3.patch, hhh-4907.patch
Original Estimate: 0 minutes
Remaining Estimate: 0 minutes
[
http://hudson.qa.jboss.com/hudson/view/Hibernate%20Community/job/hibernat...
]
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira