简体   繁体   中英

Mapping an enum to String in R2DBC

Using JPA, I can have a member within my entity that maps an enum and persists it as a String:

    @Enumerated(EnumType.STRING)
    private MyEnum myEnum;

As JPA doesn't work with R2DBC, I can't use that nice shorthand. Is there a clean way of effecting this mapping when using R2DBC?

It will map enum to string and vice versa by default without the annotation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM