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

PostgreSQLEnumType#sqlTypes() should always return Types.VARCHAR #399

Closed
pglizniewicz opened this issue Mar 2, 2022 · 2 comments
Closed
Assignees
Milestone

Comments

@pglizniewicz
Copy link

PostgreSQLEnumType does not override EnumType#sqlTypes(), what means, it will return a value based onEnumType#enumValueConverter, which is never used by PostgreSQLEnumType. enumValueConverter is chosen based on what is set in the @Enumerated, so to make it work one have to annotate a property with both @Type( type = "pgsql_enum" ) and @Enumerated(EnumType.STRING) or it will default to @Enumerated(EnumType.ORDINAL). This feels redundant, since the both annotations define a type mapping and having to specify @Enumerated(EnumType.STRING) is just a workaround for the wrong default.

@vladmihalcea
Copy link
Owner

vladmihalcea commented Mar 2, 2022

Makes sense. I'll check it out when I have some time.

@vladmihalcea
Copy link
Owner

Fixed.

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

2 participants