ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject RE: discriminator and submap
Date Sat, 04 Nov 2006 00:41:59 GMT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii" inline 
Content-Disposition: format="flowed" plain; text Content-Type: 7bit 
Content-Transfer-Encoding:>
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2><SPAN 
class=239193900-04112006>Well I did something similar but I still need to 
perform the 'else'.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2><SPAN 
class=239193900-04112006></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2><SPAN 
class=239193900-04112006>&nbsp;&nbsp;&nbsp; &lt;discriminator column="part_no"

javaType="java.lang.String" jdbcType="VARCHAR" 
nullValue="NULL"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;subMap
value="NULL" 
resultMap="SupportItemResult" /&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;/discriminator&gt;</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2><SPAN 
class=239193900-04112006></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2><SPAN 
class=239193900-04112006>My problem is that the above will apply the resultMap 
if the field part_no is null, but how do I apply a different resultMap if 
part_no is not null. I don't want to test for all possible values I only want a 
simple if/else basically.</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> larry.meadors@gmail.com 
[mailto:larry.meadors@gmail.com] <B>On Behalf Of </B>"Larry Meadors" 
&lt;lmeadors@apache.org&gt;<BR><B>Sent:</B> Friday, November 03,
2006 4:31 
PM<BR><B>To:</B> user-java@ibatis.apache.org<BR><B>Subject:</B>
Re: 
discriminator and submap<BR></FONT><BR></DIV>
<DIV></DIV>I'd probably do something like NVL(field, 'someMagicNullString') in

<BR>the sql to make sure that it wasn't null. :-/ <BR><BR>Crude, but effective.

<BR><BR>Larry <BR><BR><BR>On 11/3/06, Christopher.Mathrusse@sybase.com

<BR><CHRISTOPHER.MATHRUSSE@SYBASE.COM>wrote: <BR>&gt; <BR>&gt;
<BR>&gt; Can I 
use the discriminator and sub map to test for null values? Meaning if <BR>&gt; I

define the discriminator for a field and I want to apply one result map if 
<BR>&gt; the field is null and another if it is not, how do I define this? 
<BR>&gt; <BR>&gt; Thanks.... <BR>&gt; <BR>&gt; Chris
Mathrusse <BR>&gt; 
christopher.mathrusse@sybase.com <BR>&gt; (925) 236-5553 <BR>&gt; 
<BR><BR></BODY></HTML>


Mime
View raw message