• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use a custom class in parameterType and as a resultMap using MyBatis

Kumar Raja
Ranch Hand
Posts: 548
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

Assuming that we have a stored procedure that takes some parameters and returns a resultset.

Lets assume we have something like below

In the above example, the inputs are sent as Map, as defined in parameterType = 'map' and the output returned is of type Output_ResultMap which is a structure defined.

If I want to pass a custom class instead of Map, like say

Class MyClass
String param1;
String param2;
and output as a separate class like
Class Output{
/* some fields */


How do I define the parameterType and resultType


Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!