package org.hibernate.dialect.identity;
public class HSQLIdentityColumnSupport extends IdentityColumnSupportImpl {
final private int hsqldbVersion;
public HSQLIdentityColumnSupport(int hsqldbVersion) {
this.hsqldbVersion = hsqldbVersion;
}
@Override
public boolean supportsIdentityColumns() {
return true;
}
@Override
public String getIdentityColumnString(int type) {
return "generated by default as identity (start with 1)";
}
@Override
public String getIdentitySelectString(String table, String column, int type) {
return "call identity()";
}
@Override
public String getIdentityInsertString() {
return hsqldbVersion < 200 ? "null" : "default";
}
}