Hi,
@GeneratedValue(strategy = GenerationType.IDENTITY) was working fine with hibernate 5 + same jdbc (exasol). Now I got a strange error from driver:
com.exasol.jdbc.NotImplemented: Feature not supported - Auto-generated keys.
Old v5 was calling back:
public String getIdentitySelectString(String table, String column, int type) throws MappingException {
return "SELECT COLUMN_IDENTITY FROM EXA_ALL_COLUMNS WHERE COLUMN_NAME='"+column.toUpperCase() +
"' AND COLUMN_SCHEMA='"+table.substring(0, table.indexOf(".")).toUpperCase() +
"' AND COLUMN_TABLE='"+(table.substring(table.indexOf(".")+1)).toUpperCase()+"'";
}
Old v5 had GeneratorClass in Dialect file, and this used to work for simple logging inserts:
@Override
public Class getNativeIdentifierGeneratorClass() { return SequenceGenerator.class; }
reworked for v6:
public jakarta.persistence.GenerationType getNativeIdentifierGenerationType() {
return GenerationType.SEQUENCE;
}
Also tried with GenerationType.IDENTITY
The v5 logs told: “Inserting entity SecurityLog (native id)” - just after “ActionQueue - Executing identity-insert immediately”.
Now v6 fails just next to “ActionQueue - Executing identity-insert immediately”:
2023-09-14 22:03:45.836 [http-nio-8080-exec-3] DEBUG o.h.SQL - insert into security_log (email,id_result,ip_address,logon_date) values (?,?,?,?)
Hibernate: insert into security_log (email,id_result,ip_address,logon_date) values (?,?,?,?)
2023-09-14 22:03:45.838 [http-nio-8080-exec-3] WARN c.z.h.p.ProxyConnection - HikariPool-1 - Connection com.exasol.jdbc.EXAConnection@1b5a23ad marked as broken because of SQLSTATE(0A000), ErrorCode(0)
com.exasol.jdbc.NotImplemented: Feature not supported - Auto-generated keys.
and not mentioning “native”.
The Dialect no longer having sequence related supportsFns.
public boolean supportsPooledSequences() { return true; }
public boolean supportsSequences() {return false;}
I hope you guys will have any idea how to trigger native IDENTITY at database.
thx