ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Riebeek" <Nick.Rieb...@gov.ab.ca>
Subject RE: Using Unary condition elements to add prepended statements without tag text
Date Tue, 31 Jan 2006 16:03:44 GMT
Hi Ron,

Thanks for the suggestion, I should have fleshed out my example a bit
more.  Basically I have a number of optional parameters and if any of
them are supplied I need to add the inner join clause.  So what I am
trying to do is something like:

SELECT * 
FROM Address 
<dynamic prepend="a INNER JOIN Person p ON a.PersonID = p.PersonID"> 
	<isNotNull property="PersonName" /> 
	<isNotNull property="Prop2" />
	<isNotNull property="Prop3" /> 
</dynamic>

-----Original Message-----
From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
Sent: January 30, 2006 9:29 PM
To: user-cs@ibatis.apache.org
Subject: Re: Using Unary condition elements to add prepended statements
without tag text

What are you trying to do exactly? Why doesn't this work:

 <isNotNull property="PersonName">
  a INNER JOIN Person p ON a.PersonID = p.PersonID
 </isNotNull>

--- Nick Riebeek <Nick.Riebeek@gov.ab.ca> wrote:

> Hello, I am wondering if there is a way to get a unary condition tag
> to
> insert prepend text without having any text in the actual unary tag.
> 
>  
> 
> I.E.
> 
>  
> 
> <select id="Address.Search" resultMap=" Address.SelectResults"
> parameterMap=" Address.SearchParameterMap">
> 
> SELECT *
> 
>       FROM Address
> 
>       <dynamic prepend="a INNER JOIN Person p ON a.PersonID =
> p.PersonID">
> 
>             <isNotNull property="PersonName">
> 
>                   
> 
>             </isNotNull>
> 
>       </dynamic>
> 
>  
> 
>  
> 
> I've noticed if I add some text to the isNotNull tag, then the
> prepended
> INNER JOIN statement gets added, without text unfortunately it
> doesn't.
> 
>  
> 
>  
> 
> Thanks.
> 
> This communication is intended for the use of the recipient to which
> it is addressed, and may contain confidential, personal and or
> privileged information. Please contact us immediately if you are not
> the intended recipients of this communication, and do not copy,
> distribute, or take action relying on it. Any communication received
> in error, or subsequent reply, should be deleted or   destroyed.
> 
> 

This communication is intended for the use of the recipient to which it is addressed, and
may contain confidential, personal and or privileged information. Please contact us immediately
if you are not the intended recipients of this communication, and do not copy, distribute,
or take action relying on it. Any communication received in error, or subsequent reply, should
be deleted or   destroyed.


Mime
View raw message