I have an object that has composited id:
Code:
<composite-id name="comId" class="ComId">
<key-property name="id"/>
<key-property name="rev"/>
</composite-id>
All the bulk operations fail. For example:
Code:
session.createQuery("update MyObject co set co.someField = false where co.comId = :id ")
.setInteger("id", myObj.getComId().getId().intValue())
.executeUpdate();
results in two queries:
Code:
insert into HT_MyObject select * from MyObject bulk_target where id=556 and someField=1
update MyObject set someField=0 where (id, rev) IN (select id, rev from HT_MyObject)
second query fails with:
Quote:
Unexpected token: , in statement
Same thing happens for HQL bulk delete "DELETE MyObject co WHERE co.comId.id = :id" causes:
Full stack trace of any exception that occurs:Code:
uncategorized SQLException for SQL [delete from MyObject where (id, rev) IN (select id, rev from HT_MyObject)];
SQL state [37000]; error code [-11]; Unexpected token: , in statement [delete from MyObject where (id, rev) IN (select id, rev from HT_MyObject)];
nested exception is java.sql.SQLException: Unexpected token: , in statement [delete from MyObject where (id, rev) IN (select id, rev from HT_MyObject)]
java.sql.SQLException: Unexpected token: , in statement [delete from MyObject where (id, rev) IN (select id, rev from HT_MyObject)]
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:185)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:278)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:442)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:93)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:86)
at org.hibernate.hql.ast.exec.MultiTableDeleteExecutor.execute(MultiTableDeleteExecutor.java:113)
at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:334)
at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:209)
at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1148)
at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:94)
Name and version of the database you are using: HSQL 1.8.0
Hibernate version: 3.1.2
Are these operation not yet supported, or should I file it to JIRA?
Thanks in advance,
Lukasz