You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "Barnett, Brian W." <bb...@scholarinc.com> on 2005/01/25 23:03:48 UTC

global resultMaps ??

Is there a way to create a resultMap that can be referenced in separate sql
map.xml files, or do I have to duplicate the resultMap in each file I want
to use it in?

What about cacheModels?

Thanks,
Brian Barnett

Re: global resultMaps ??

Posted by Brice Ruth <bd...@gmail.com>.
You should be able to reference result-maps (really, anything you've
defined, I think) in any SqlMaps that come *after* the map you've
defined it in. By *after* I mean the order in which you defined you
SqlMap files in your sql-map-config file.

So, if you wanted global maps, just create a separate file and make
that the first in your sql-map-config.

That should work!


On Tue, 25 Jan 2005 16:03:48 -0600, Barnett, Brian W.
<bb...@scholarinc.com> wrote:
> Is there a way to create a resultMap that can be referenced in separate sql
> map.xml files, or do I have to duplicate the resultMap in each file I want
> to use it in?
> 
> What about cacheModels?
> 
> Thanks,
> Brian Barnett
>

Re: global resultMaps ??

Posted by Clinton Begin <cl...@gmail.com>.
Sure.  Define it in a separate result map and ensure that it is
declared first in the config file.  Also be sure to prefix it with the
id of the sql map file.

Cheers,
Clinton

On Tue, 25 Jan 2005 16:03:48 -0600, Barnett, Brian W.
<bb...@scholarinc.com> wrote:
> Is there a way to create a resultMap that can be referenced in separate sql
> map.xml files, or do I have to duplicate the resultMap in each file I want
> to use it in?
> 
> What about cacheModels?
> 
> Thanks,
> Brian Barnett
>