ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heath, Douglas T" <douglas.t.he...@ttu.edu>
Subject RE: Long/int not working
Date Fri, 11 Feb 2005 18:11:59 GMT
Ok, I set that, but still no luck. One thing that I don't know if I
pointed out is that it _does_ work for string elements, but not int/long
or datetime. I've attached the xml and related classes.
 
The only thing that doesn't work is the search. 
 
Thanks in advance!
Terry

________________________________

From: roberto [mailto:roberto@theaegis.org] 
Sent: Thursday, February 10, 2005 12:26 PM
To: ibatis-user-cs@incubator.apache.org
Subject: RE: Long/int not working



Doh!  Sorry, I meant:

 

<select id="PAF_ACTION_CT_MAINSearch"
resultMap="PAF_ACTION_CT_MAINResult"
parameterClass="yourClassNameTypeAlias_Or_FullNamespaceAndAssembly"> 

 

...needs to be added as an attribute of your select element.

 

Roberto

 

 

> -----Original Message-----

> From: Heath, Douglas T [mailto:douglas.t.heath@ttu.edu]

> Sent: Thursday, February 10, 2005 1:11 PM

> To: ibatis-user-cs@incubator.apache.org

> Subject: RE: Long/int not working

> 

> Here's the code:

> 

> Public Class PAF_ACTION_CT_MAIN

>     Inherits DBElement ' gives two private fields and properties,

> USERID(string) and TIMESTAMP(datetime)

> 

> #Region "Private Fields"

> 

>     Private _ACTION_CT_ID As Long = -9999

>     Private _ACTION_CD As String = ""

> 

> #End Region

> 

> 

> #Region "Properties"

> 

>     Public Property ACTION_CT_ID() As Long

>           Get

>                 Return Me._ACTION_CT_ID

>           End Get

>           Set(ByVal Value As Long)

>                 Me._ACTION_CT_ID = Value

>           End Set

>     End Property

> 

>     Public Property ACTION_CD() As String

>           Get

>                 Return Me._ACTION_CD

>           End Get

>           Set(ByVal Value As String)

>                 Me._ACTION_CD = Value

>           End Set

>     End Property

> 

> #End Region

> 

> 

> End Class

> 

> ---------------------------------

> 

> Imports IBatisNet.DataAccess

> 

> Public Class PAF_ACTION_CT_MAINService

>     Inherits Service

> 

>     Public Overrides Function search(ByVal element As DBElement) As

> IList

>           Return Mapper().QueryForList("PAF_ACTION_CT_MAINSearch",

> element)

>     End Function

> 

> End Class

> -------------------------------

> 

> Is that what you meant?

> 

> Thanks,

> Terry

> 

> -----Original Message-----

> From: roberto [mailto:roberto@theaegis.org]

> Sent: Thursday, February 10, 2005 12:07 PM

> To: ibatis-user-cs@incubator.apache.org

> Subject: RE: Long/int not working

> 

> parameterClass=?

> 

> Roberto

> 

> > -----Original Message-----

> > From: Heath, Douglas T [mailto:douglas.t.heath@ttu.edu]

> > Sent: Thursday, February 10, 2005 11:45 AM

> > To: ibatis-user-cs@incubator.apache.org

> > Subject: Long/int not working

> >

> > Hi -

> >

> > This is what my xml looks like for this function:

> >  <select id="PAF_ACTION_CT_MAINSearch"

> > resultMap="PAF_ACTION_CT_MAINResult">

> >             select

> >                 ACTION_CT_ID,

> >                 ACTION_CD,

> >                 USERID,

> >                 TIMESTAMP

> >             from [PAF_ACTION_CT_MAIN]

> >             <dynamic prepend="where">

> >             <isParameterPresent>

> >                 <isNotEqual property="ACTION_CT_ID"

> compareValue="-9999"

> > prepend="and">

> >                     ACTION_CT_ID = #ACTION_CT_ID#

> >                 </isNotEqual>

> >                 <isNotEmpty property="ACTION_CD" prepend="and">

> >                     ACTION_CD = #ACTION_CD#

> >                 </isNotEmpty>

> >                 <isNotEmpty property="USERID" prepend="and">

> >                     USERID = #USERID#

> >                 </isNotEmpty>

> >                 <isNotEqual property="TIMESTAMP"

> > compareValue="1/1/0001 12:00:00 AM" prepend="and">

> >                     TIMESTAMP = #TIMESTAMP#

> >                 </isNotEqual>

> >             </isParameterPresent>

> >             </dynamic>

> >         </select>

> >

> > For some reason, even if I set ACTION_CT_ID to 1 or 500 or any
value,

> > it doesn't append the ACTION_CT_ID=#ACTION_CT_ID# into my query, so
it

> 

> > ends up just selecting everything from the table. In my code,

> > ACTION_CT_ID is a long.

> >

> > Does anyone know what I'm doing wrong?

> >

> > Thanks,

> > Terry

 


Mime
View raw message