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

Support conversion between Enum and Integer [SPR-14039] #18611

Closed
spring-projects-issues opened this issue Mar 11, 2016 · 1 comment
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Yanming Zhou opened SPR-14039 and commented

DefaultConversionService have conversion between Enum and String using Enum.name() , It's reasonable to add conversion for Integer using Enum.ordinal() .
JPA use ordinal as default mapping:

package javax.persistence;
public @interface Enumerated {
    EnumType value() default ORDINAL;
}

Developers can extends BeanPropertyRowMapper and set DefaultConversionService to BeanWrapper, doesn't need write Converters, I'm glad to provide a pull request.


Referenced from: pull request #998, and commits f422e49, 1c3c88f

@spring-projects-issues
Copy link
Collaborator Author

Yanming Zhou commented

I have created PR #998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants