Guy Rouillier
unread,Oct 28, 2012, 3:10:03 PM10/28/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mybati...@googlegroups.com
On 10/27/2012 12:08 PM, Kilian wrote:
> Hi all,
>
> I'm trying to create an example project where I use different ORMs
> implementations of a given interface. I've already created one for jpa,
> hibernate and jdbc but I have problems with the one with MyBatis.
> For what I want, I need to modify return types of some of the methods
> created by MyBatis. I've already created an interface with annotations
> for one of my models and it works but I need the insert statement to
> return the object created with its autogenerated id, not the number of
> rows modified. It'd be great if it was possible to override the
> implementation created by MyBatis of this interface so I could add some
> behaviour after each method created. Is this possible?
We just implemented a wrapper class around the MyBatis interface class
that adds any additional behavior desired. If the app doesn't need any
additional behavior for a particular mapper method, it can invoke the
mapper interface directly; or if you prefer to maintain consistency, in
such cases, your wrapper class method is a sample "return mapper.method()".
--
Guy Rouillier