Base Interface for Mappers

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

Base Interface for Mappers

rwfischer

Hello,


is there any plan for the generated mappers to extend a base interface?


The models (POJO) supports a base class (optional), but the mappers do not.


I see a couple of benefits for a base interface:

  • When using generics, the type can be constrained to classes derived from BaseMapper.
  • Obtain some meta-data from the mapper (not sure at this time what would be useful).


Roger


--
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].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Base Interface for Mappers

Jeff Butler
You can specify a rootInterface for mappers on the javaClientGenerator configuration.

Jeff Butler


On Wed, Aug 30, 2017 at 7:29 PM Roger Fischer <[hidden email]> wrote:

Hello,


is there any plan for the generated mappers to extend a base interface?


The models (POJO) supports a base class (optional), but the mappers do not.


I see a couple of benefits for a base interface:

  • When using generics, the type can be constrained to classes derived from BaseMapper.
  • Obtain some meta-data from the mapper (not sure at this time what would be useful).


Roger


--
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].
For more options, visit https://groups.google.com/d/optout.

--
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].
For more options, visit https://groups.google.com/d/optout.