E
- the enum type that should be written using the actual value.@WritingConverter public abstract class EnumWriteSupport<E extends Enum<E>> extends Object implements Converter<E,E>
Enum
values to the database.
By default, Spring Data converts enum values by to String
for maximum portability. Registering a
WritingConverter
allows retaining the enum type so that actual enum values get passed thru to the driver.
Enum types that should be written using their actual enum value to the database should require a converter for type
pinning. Extend this class as the CustomConversions
support inspects
Converter
generics to identify conversion rules.
For example:
enum Color { Grey, Blue } class ColorConverter extends EnumWriteSupport<Color> { }
Constructor and Description |
---|
EnumWriteSupport() |
Copyright © 2018–2021 Pivotal Software, Inc.. All rights reserved.