ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Putnam <dput...@wellsfargo.com>
Subject RE: Referencing between SqlMaps
Date Mon, 07 Mar 2005 15:17:34 GMT
Tim,

I have not tried this, but since no one else responded, let me mention
something you probably already tried.
Did you set useStatementNamespaces to true?

The other item is one that I am currently struggling with. Even though this
is not part of iBatis, per. se., it is a consequence of using multiple
SqlMap definition files. Currently, I define all SQL that retrieves or
modifies a specific domain object in the same SqlMap file. Even then there
are still references to different parameterClasses, but there is not as much
definition required there.  Just trying to keep things DRY.

David

-----Original Message-----
From: Tim Christopher [mailto:tim.christopher@gmail.com]
Sent: Monday, March 07, 2005 08:46
To: ibatis-user-java@incubator.apache.org
Subject: Re: Referencing between SqlMaps


Hi,

Sorry for replying to my own post like this but does anyone actually
know if it is possible to reference between SqlMaps...  It's driving
me crazy having to search through all my SqlMaps to make sure I have
changed all the neccessary resultmaps everytime I update an object.

I'd love to be able to refer to a resultmap from another file to save
having to declare the same thing in mutliple files...  If this is not
currently possible, are there any plans to add it in the future?

Tim Christopher

On Thu, 3 Mar 2005 23:54:57 +0000, Tim Christopher
<tim.christopher@gmail.com> wrote:
> Hi,
> 
> Can any tell me how I can reference a statement that is stored within
> a different SqlMap?
> 
> I'm sure I can remember reading in one of the docs that this is
> possible but I've tried what I thought I can remember it saying and it
> doesn't work.
> 
> Here's a line from within my resultMap:
> <result property="anObj"   column="OBJ_ID"  select="AnObj.getById"/>
> 
> If I create a statement within the same SqlMap and change the select
> statement to "getById" (instead of "AnObj.getById") it works fine...
> But by leaving it how it is and moving the "getById" statement to the
> AnObj.xml SqlMap it throws the following Exception:
> 
> SqlMapException: There is no statement named AnObj.getById in this SqlMap.
> 
> Is what I'm trying to do actually possible?  And if so any advice
> would be greatly appreciated.
> 
> Tim Christopher
>



*****DISCLOSURE STATEMENT*****
This transmission may contain information which is confidential, proprietary
and privileged.  If you are not the individual or entity to which it is
addressed, note that any review, disclosure, copying, retransmission or
other use is strictly prohibited.  If you received this transmission in
error, please notify the sender immediately and delete the material from
your system.  This transmission is for informational purposes only, and is
not intended as an offer or solicitation for the purchase or sale of any
financial instrument or as an official confirmation of any transaction.  Any
information regarding specific investments or other products is not
warranted as to completeness or accuracy and is subject to change without
notice.

Mime
View raw message