The "org.hibernate.dialect.InformixDialect" doesn't support limit. here is a snippet from the class:
public boolean supportsLimitOffset() {
return false;
}
public String getLimitString(String querySelect, int offset, int limit) {
if ( offset > 0 ) {
throw new UnsupportedOperationException( "query result offset is not supported" );
}
return new StringBuffer( querySelect.length() + 8 )
.append( querySelect )
.insert( querySelect.toLowerCase().indexOf( "select" ) + 6, " first " + limit )
.toString();
}
You could extend this class to create a custom dialect. Then override both of the above methods.
public boolean supportsLimitOffset() {
return true;
}
public String getLimitString(String querySelect, int offset, int limit) {
return new StringBuffer( querySelect.length() + 8 )
.append( querySelect )
.insert( querySelect.toLowerCase().indexOf( "select" ) + 6," skip " + offset + " first " + limit).toString();
}