GenerationType.SEQUENCE can be used with DB2400Dialect if two methods were added as follows. I created my own dialect class so that I could get my application working.
Code:
package com.liebert.hibernate;
public class DB2400Dialect extends org.hibernate.dialect.DB2400Dialect
{
public boolean supportsSequences() {
return true;
}
public String getSequenceNextValString(String sequenceName) {
return "select nextval for " + sequenceName + " from sysdummy1";
}
}
If org.hibernate.dialect.DB2400Dialect is updated I would use it. I would also make the change but I don't have the time now and I'm not familiar with how to contribute.
"sysdummy1" needs to be "sysibm.sysdummy1" if naming=sql property is used. See
http://forum.hibernate.org/viewtopic.php?t=973837