New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ddl-generator: Identity for PK is always generated #3399
Comments
Use This defaults to true and means that |
The above globally turns off ebeans implicit behaviour. An alternative for the case that MOST entities use Identity or Sequence and only a few are application controlled identity values, then we can use ebean specific @Id @Identity(type=APPLICATION)
Long id; |
I love your project. You have everything: beyond anyone could dream of 🤝🔥 I have recently modernized a legacy project. And among other things, I have replaced jOOQ by Ebean. The code is more concise and readable now. |
Thanks for that, it's great getting feedback. There is some missing documentation on this which should be added at: https://ebean.io/docs/mapping/jpa/id#generated-value ... so I'll look to do that. Cheers, Rob. |
Ok, I've update the website documentation. We can close this now. |
I generate ID in my App in java code, so my id column is declared in entity class as:
but DdlGenerator generates such columns as:
id bigint identity(1,1) not null,
instead of expected:
id bigint not null,
MSSQL doesn't allow then insert values into column id, because id is an identity column.
The same is true for MySQL (identity related keywords are added).
see
io.ebeaninternal.dbmigration.model.MTableIdentity#fromCreateTable
io.ebeaninternal.dbmigration.ddlgeneration.platform.BaseTableIdentity#identity
The text was updated successfully, but these errors were encountered: