About id mapping

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

About id mapping

Lauro Schuck
Hi,

I'm currently working on a project using iBatis 2, and I'm going to ressurect another project in which I plan to switch the persistence framework from ORM to MyBatis 3.
I was reading through the User Guide, and there I read about the <id> mapping (that our current project does not use at all). It is mentioned that using it improves overall performance. Now, I can understand that it could be useful for caching, but does it provide any other immediate benefit if you are not using caching?

I know this question is probably silly, but I want to get a good understanding of iBatis/MyBatis, so I can use the best it can offer on my new project, and even improve the current one.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: About id mapping

Clinton Begin
Administrator
It is primarily used for caching, but ibatis has two levels of
caching.  The SqlSession level cache cannot be turned off.

That said, versions 1 and 2 didn't support id fields, and the
performance was fine.  It's pretty hard to be worse than accessing the
DB.  :-)

So if you don't use id fields, you should still be fine.  That said,
you can always go back later and add them, but if you can, try to get
them in from the start.

Clinton



On 2010-10-25, Lauro Schuck <[hidden email]> wrote:

> Hi,
>
> I'm currently working on a project using iBatis 2, and I'm going to
> ressurect another project in which I plan to switch the persistence
> framework from ORM to MyBatis 3.
> I was reading through the User Guide, and there I read about the <id>
> mapping (that our current project does not use at all). It is mentioned that
> using it improves overall performance. Now, I can understand that it could
> be useful for caching, but does it provide any other immediate benefit if
> you are not using caching?
>
> I know this question is probably silly, but I want to get a good
> understanding of iBatis/MyBatis, so I can use the best it can offer on my
> new project, and even improve the current one.
>
> Thanks.
>

--
Sent from my mobile device