Limit issues with apache derby and hbm2ddl

We use Apache Derby 10.5.3.0_1 and hbm2ddl with Hibernate 3.3.x

I get the following constraint error when preloading SQL into derby's built-in database. If I delete the primary key (id) from the create sql table, it will be able to create the table. Not sure if the problem is here.

create table user_flow (id integer not null generated always as identity unique, creation_date timestamp not null, name varchar(255), primary key (id)); [INFO] Constraints 'SQL100219175052781' and 'SQL100219175052780' have the same set of columns, which is not allowed. 
+1
source share
1 answer

This is DERBY-789 , I believe, and has not yet been fixed. The main problem is that the column is declared both “unique” and “primary key”, which forces Derby to try to create two constraint indexes. Since the "primary key" already implies the "unique", you can simply omit the "unique", which, I think, is better than omit the "primary key".

+5
source

Source: https://habr.com/ru/post/904379/


All Articles