Skip to content
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

Enhance @Column annotation to allow for specifying custom SQL type, as well as length/precision. #1488

Closed
Tracked by #756
kurtn718 opened this issue Apr 8, 2023 · 1 comment

Comments

@kurtn718
Copy link
Contributor

kurtn718 commented Apr 8, 2023

Enhance @column annotation to allow for specifying custom SQL types, as well as well as length/precision.

For this enhancement we will be taking what is in the JPA standard that is relevant to Schema generation.

https://docs.oracle.com/javaee/7/api/javax/persistence/Column.html

  • columnDefinition
  • length
  • nullable
  • precision
  • scale
@kurtn718
Copy link
Contributor Author

Closing out this ticket. We have decided to NOT implement this feature.

While it is definitely tempting to add, the database SQL script(s) itself should be the definitive source of truth.

Also adding the ability to specify a custom SQL type via annotation would also make the generated schema database dependent (i.e. if one specified VARCHAR2(30) that would work great for Oracle but not for other database types).

In short, specifying the type at the annotation level in Code is not the right place to do it.

If we did want to have such a feature (to specify via code) the right place to do it would be in the SchemaSQLGenerationDataModel class.

When we create the model, an array containing <Table, Column, Custom-Type> could be passed in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant