ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject RE: Define Factory to instantiate Objects?
Date Fri, 29 Jun 2007 15:50:27 GMT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii" 
format="flowed" plain; text Content-Type: 7bit Content-Transfer-Encoding:>
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=668134815-29062007><FONT face=Arial 
color=#0000ff size=2>You can define a ResultObjectFactory in the 
SqlMapClient.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=668134815-29062007><FONT size=2>
<P align=left>ExtendedSqlMapClient client = (ExtendedSqlMapClient) 
getObject();</P>
<P align=left>client.getDelegate().setResultObjectFactory(</FONT><FONT 
color=#0000c0 size=2>resultObjectFactory</FONT><FONT 
size=2>);</P></FONT></SPAN></DIV>
<DIV><SPAN class=668134815-29062007></SPAN><FONT face=Arial><FONT

color=#0000ff><FONT 
size=2>This&nbsp;factory&nbsp;will&nbsp;then&nbsp;be&nbsp;used&nbsp;by&nbsp;iBatis&nbsp;to&nbsp;instantiate&nbsp;all&nbsp;of&nbsp;your&nbsp;ResultMap&nbsp;objects.&nbsp;Take&nbsp;a&nbsp;look&nbsp;at&nbsp;the&nbsp;API&nbsp;documentation.</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=668134815-29062007></SPAN></FONT></FONT></FONT><BR>&nbsp;</DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Tom Schindl 
&lt;tom.schindl@bestsolution.at&gt; [mailto:Tom Schindl 
&lt;tom.schindl@bestsolution.at&gt;] <BR><B>Sent:</B> Friday, June
29, 2007 8:03 
AM<BR><B>To:</B> user-java@ibatis.apache.org<BR><B>Subject:</B>
Define Factory 
to instantiate Objects?<BR></FONT><BR></DIV>
<DIV></DIV>Hi, <BR><BR>is it possible to teach iBatis to use a Factory-method
to 
instatiate a <BR>class? In my case the constructor is protected (or even better 
the <BR>specified type is an interface) and the objects are normally 
<BR>instantiated using a Factory (for those interested I'm working with 
<BR>Objects generated from Eclipse EMF). <BR><BR>I'd e.g. like to say 
<BR><BR>-----------8&lt;----------- <BR><TYPEALIAS <BR>alias="Client"

<BR>type="at.bestsolution.model.IClient" 
<BR>factory="MyModelFactory.createClient" /&gt; <BR>-----------8&lt;-----------

<BR><BR>Please note also that in this case IClient is an Interface and the 
<BR>Factory will take care to create the appropriate real implementation 
<BR>(ClientImpl). <BR><BR>Tom <BR><BR></BODY></HTML>


Mime
View raw message