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:[EMAIL PROTECTED]
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:[EMAIL PROTECTED]

> 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:[EMAIL PROTECTED]

> 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:[EMAIL PROTECTED]

> > 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

 

FILE DELETED
------------

Antigen for Exchange removed PAF_ACTION_CT_MAIN.vb since it
was found to match the FILE FILTER= *.vb file filter.
FILE DELETED
------------

Antigen for Exchange removed PAF_ACTION_CT_MAINService.vb since it
was found to match the FILE FILTER= *.vb file filter.
FILE DELETED
------------

Antigen for Exchange removed DBElement.vb since it
was found to match the FILE FILTER= *.vb file filter.
<?xml version="1.0" encoding="utf-8" ?>
<sqlMap 
    namespace="PAF_ACTION_CT_MAIN" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
    xsi:noNamespaceSchemaLocation="SqlMap.xsd">

    <alias>
        <typeAlias alias="PAF_ACTION_CT_MAIN" type="DataLayer.PAF_ACTION_CT_MAIN, DataLayer" />
    </alias>

    <parameterMaps>

        <parameterMap id="InsertPAF_ACTION_CT_MAINParam" class="PAF_ACTION_CT_MAIN">
            <parameter property="ActionCd" />
            <parameter property="UserID" />
            <parameter property="Timestamp"/>
        </parameterMap>

        <parameterMap id="UpdatePAF_ACTION_CT_MAINParam" extends="InsertPAF_ACTION_CT_MAINParam">
            <parameter property="ActionCTId" nullValue="-9999" />
        </parameterMap>

    </parameterMaps>

    <resultMaps>

        <resultMap id="PAF_ACTION_CT_MAINResult" class="PAF_ACTION_CT_MAIN">
            <result property="ActionCTId" column="ActionCTId" nullValue="-9999" />
            <result property="ActionCd" column="ActionCd" />
            <result property="UserID" column="UserID" />
            <result property="Timestamp" column="Timestamp"/>
        </resultMap>

    </resultMaps>

    <statements>

    <!-- Generated Statements -->

        <insert id="PAF_ACTION_CT_MAINCreate" parameterMap="InsertPAF_ACTION_CT_MAINParam">
            <selectKey property="ActionCTId" resultClass="Integer">
                select cast(@@IDENTITY as int) as value
            </selectKey>
            insert into [PAF_ACTION_CT_MAIN] (
                ActionCd, 
                UserID, 
                Timestamp
            ) values (
                ?, 
                ?, 
                ?
)        </insert>

        <update id="PAF_ACTION_CT_MAINUpdate" parameterMap="UpdatePAF_ACTION_CT_MAINParam">
            update [PAF_ACTION_CT_MAIN] set 
                ActionCd = ?, 
                UserID = ?, 
                Timestamp = ?
            where 
                ActionCTId = ?
        </update>

        <delete id="PAF_ACTION_CT_MAINDelete">
            delete from [PAF_ACTION_CT_MAIN]
            where 
                ActionCTId = #ActionCTId#
        </delete>

        <select id="PAF_ACTION_CT_MAINFindByPrimaryKey" resultMap="PAF_ACTION_CT_MAINResult">
            select 
                ActionCTId, 
                ActionCd, 
                UserID, 
                Timestamp
            from [PAF_ACTION_CT_MAIN]
            where 
                ActionCTId = #ActionCTId#
        </select>

        <select id="PAF_ACTION_CT_MAINSearch" resultMap="PAF_ACTION_CT_MAINResult" parameterMap="InsertPAF_ACTION_CT_MAINParam">
            select 
                ActionCTId, 
                ActionCd, 
                UserID, 
                Timestamp
            from [PAF_ACTION_CT_MAIN]
            <dynamic prepend="where">
            <isParameterPresent>
                <isNotEqual property="ActionCTId" compareValue="-9999" prepend="and">
                    ActionCTId = #ActionCTId#
                </isNotEqual>
                <isNotEmpty property="ActionCd" prepend="and">
                    ActionCd = #ActionCd#
                </isNotEmpty>
                <isNotEmpty property="UserID" prepend="and">
                    UserID = #UserID#
                </isNotEmpty>
                <isNotEqual property="isTimeSet" compareValue="True" prepend="and">
                    Timestamp = #SQLTimestamp#
                </isNotEqual>
            </isParameterPresent>
            </dynamic>
        </select>

    <!-- End Generated Statements -->

    </statements>

</sqlMap>

Reply via email to