Search code examples
enumsignite

Apache Ignite map string to enum


I want to map a database VARCHAR value into an enum value in the model. I modified the field definition in QueryEntity and in JdbcTypeField such that the field type is my enum (instead of java.lang.String and String.class, respectively). The code executes but the value inserted in the DB is the ordinal corresponding to the enum value.

Is there a solution to this or is string to enum (and vice versa) conversion not supported?

Thanks!


Solution

  • You can try to implement JdbcTypesTransformer (or extend existing JdbcTypesDefaultTransformer) to create your own mapping for specific column. The implementation can be provided in configuration via CacheJdbcPojoStoreFactory#transformer property.