Using Hibernate 4, the below generated query failed :
delete from ErpEmploye_AUD where (code, folder_codeId, REV)
IN
(select code, folder_codeId, REV from HT_ErpEmploye_AUD where hib_sess_id=1)
Firebird Exception :
SQL error code = -104
Token unknown - line 1, column 39
,
In the org.hibernate.hql.spi.TableBasedDeleteHandlerImpl Class there is https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/hql/spi/TableBasedDeleteHandlerImpl.java
private String generateDelete(String tableName, String[] columnNames,
String idSubselect, String comment) {
final Delete delete = new Delete()
.setTableName( tableName )
.setWhere( "(" + StringHelper.join( ", ", columnNames ) +
") IN (" + idSubselect + ")" );
return delete.toStatementString();
}
So i want to adapt the code to Firebird, what is the nearest Firebird syntaxe to do same job?
i just migrate to hibernate 4, and it apeare that every delete from the temporary tables added in hibernate 4 (prefixed with HT_ ...) is based on this method so it looks as an important issue.