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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Kai Huang
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/b7bb0525-54a0-482e-8eb5-653f93ae4c19%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

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

Iwao AVE!
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 <[hidden email]> 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/b7bb0525-54a0-482e-8eb5-653f93ae4c19%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/CA%2Buep2QfDLBz71qijxZ95A0kPBQ0SEo75mAg8iuRkwec3nnvHQ%40mail.gmail.com.