Skip to content
Advertisement

Is there anyway to convert json to java bean through mybatis mapper?

In case I have a mysql join query result set, it is in json format, like this:

JavaScript

and the mybatis mapper

JavaScript

I can’t access this mysql instance directly, I can only export query result in json format through some “proxy platform”, is there anyway convert the json to org.example.mybatis.dto.User through the existing mybatis mapper easily?

PS: I tried to use mybatis Interceptor to intercept ResultSetHandler.handleResultSets, but it seems that I must mock Statement and ResultSet

Advertisement

Answer

JOOQ can convert txt/json/csv to ResultSet

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement