I think it would be really cool to have custom type mapper that are used during the annotation processing (for enum, etc ...)
Maybe add an annotation @Mapper on top of a class that inherit from an interface Mapper<T, R> where T is the database type and R is our custom type.
We could go even further if T could be any of the basic handled types or a custom mapped type.
With this we could define a Mapper<String, BigNumber> and a Mapper<BigNumber, SpecialNumber> that would allow to directly map from String to SpecialNumber.
In case of multiple Mapper defined for the same type, we could throw an Ambiguous exception at compile time (yay Scala implicit system).
I think it would be really cool to have custom type mapper that are used during the annotation processing (for enum, etc ...)
Maybe add an annotation
@Mapperon top of a class that inherit from an interfaceMapper<T, R>whereTis the database type andRis our custom type.We could go even further if
Tcould be any of the basic handled types or a custom mapped type.With this we could define a
Mapper<String, BigNumber>and aMapper<BigNumber, SpecialNumber>that would allow to directly map fromStringtoSpecialNumber.In case of multiple Mapper defined for the same type, we could throw an Ambiguous exception at compile time (yay Scala implicit system).