Is it possilbe to put the raw row data into ResultHandler?

12 views
Skip to first unread message

Kai Huang

unread,
Aug 10, 2019, 4:34:33 AM8/10/19
to mybatis-user
I want to do some customization to the result of a query,  for example, do some json deserialize or decrypt.
But I found the method handleResult(ResultContext<? extends Object> rc)  in ResultHandler<T> class does not provide the raw row data, but the data I wanted to work with is not in the <T> class , but in another column of the row. and I check out that the only ResultContext<T> subclass is DefaultResultContext<T>, it is hard coded in DefaultResultSetHandler , so I wonder if it is possible to add raw row data in the ResultContext class , so the user can better customize the result, or is there any better way to do this?

Iwao AVE!

unread,
Aug 11, 2019, 11:18:09 AM8/11/19
to mybatis-user
Hi Kai,

Type handler might be what you are looking for.
If you need further help, please post some example DB data and Java objects and explain how you want to map them.

Regards,
Iwao


On Sat, Aug 10, 2019 at 5:34 PM Kai Huang <ibl...@gmail.com> wrote:
I want to do some customization to the result of a query,  for example, do some json deserialize or decrypt.
But I found the method handleResult(ResultContext<? extends Object> rc)  in ResultHandler<T> class does not provide the raw row data, but the data I wanted to work with is not in the <T> class , but in another column of the row. and I check out that the only ResultContext<T> subclass is DefaultResultContext<T>, it is hard coded in DefaultResultSetHandler , so I wonder if it is possible to add raw row data in the ResultContext class , so the user can better customize the result, or is there any better way to do this?

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/b7bb0525-54a0-482e-8eb5-653f93ae4c19%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages