You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now identities for Derby are generated with GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1).
I would like to suggest the following changes that could be made based on some system variables or some Batoo configuration variables:
Possibility to use GENERATED ALWAYS AS IDENTITY or GENERATED BY DEFAULT AS IDENTITY.
Possibility to define start value (default would be 1).
Possibility to define increment value (default would be 1).
I think these changes are important since they can help a lot in unit testing. When I re-import again the data in DB it always generates me new value for ID because of ALWAYS.
The text was updated successfully, but these errors were encountered:
I think we can add the identity sql part as a parameter from the code snippet;
publicStringcreateColumnDDL(AbstractColumncolumn) {
finalbooleanidentity = column.getIdType() == IdType.IDENTITY;
returncolumn.getName() + " "// name part
+ this.getColumnType(column, column.getSqlType()) // data type part
+ (!column.isNullable() ? " NOT NULL" : "") // not null part
+ (column.isUnique() ? " UNIQUE" : "") // not null part
+ (identity ? " GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1)" : ""); // auto increment part
}
I will need some of your advice to implement this...
Adaptors have no configuration, while this one might require some... I see the following ways of doing this:
Use the EntityManagerFactoryImpl#properties to provide configuration (and they can be set in persistence.xml).
Use some System variables to provide the configuration values.
Both...
Create your own annotation to configure this like a sequence.
The thing with these identities in some database is that they act as a configurable sequence over a table. JPA has nothing to give you for configuring this so you should do this somehow.
Given this issue, I think you should decide how the implementation should proceed.
Q1: Should I fork the project and implemented there or create a branch here?
Q2: Should a start from master or a specific branch?
Hello,
Right now identities for Derby are generated with
GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1)
.I would like to suggest the following changes that could be made based on some system variables or some Batoo configuration variables:
GENERATED ALWAYS AS IDENTITY
orGENERATED BY DEFAULT AS IDENTITY
.I think these changes are important since they can help a lot in unit testing. When I re-import again the data in DB it always generates me new value for ID because of
ALWAYS
.The text was updated successfully, but these errors were encountered: