Skip to content

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

@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions