Title: Mapping across namespaces

Then you probably didn’t set useStatementNamespaces to "true" in the sqlMapConfig-file…

 

Niels

 


From: Patrick Lightbody [mailto:[EMAIL PROTECTED]
Sent: woensdag 7 september 2005 19:28
To: [email protected]
Subject: RE: Mapping across namespaces

 

Changing the order didn’t help, but removing the “CatetgoryValue” namespace did. I did some debugging and inside the delegate all the mappings are stored without any namespace. Why is that?

 

_________________
Patrick Lightbody
Professional Services
Jive Software
[EMAIL PROTECTED]
www.jivesoftware.com

317 SW Alder, Ste 500
Portland, OR 97204
ph (503) 295-6552
fx (503) 961-1047


From: Niels Beekman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 07, 2005 10:23 AM
To: [email protected]
Subject: RE: Mapping across namespaces

 

Are you including CategoryValue.xml before User.xml? iBATIS currently has a loading-order dependency, so all statements referenced should already be loaded…

 

Niels

 


From: Patrick Lightbody [mailto:[EMAIL PROTECTED]
Sent: woensdag 7 september 2005 19:18
To: [email protected]
Subject: Mapping across namespaces

 

I can’t seem to get this working. Is it even supported?

User.xml:

<sqlMap namespace="User">

    <typeAlias alias="user" type="com.jivesoftware.profiles.model.User"/>

    <resultMap id="userResult" class="user">

        <result property="id" column="user_id"/>

        <result property="username" column="username"/>

        <result property="passwordHash" column="password_hash"/>

        <result property="admin" column="admin"/>

        <result property="categoryValues" column="user_id" select="CategoryValue.getCategoryValuesForUserId"/>

    </resultMap>

</sqlMap>

CategoryValue.xml:

<sqlMap namespace="CategoryValue">

    <typeAlias alias="categoryValue" type="com.jivesoftware.profiles.model.CategoryValue"/>

   

    <select id="getCategoryValuesForUserId" resultMap="categoryValueResult" parameterClass="long">

        SELECT cv.category_id, cv.name, cv.description, cv.value

        FROM category_value cv, cat_user_value cuv

        WHERE AND cv.category_id = cuv.category_id AND cuv.user_id = #value#

        ORDER BY value

    </select>

   

</sqlMap>

I am getting this error:

--- The error occurred in mappings/User.xml. 

--- The error occurred while applying a result map. 

--- Check the User.userResult. 

--- Check the result mapping for the 'categoryValues' property. 

--- Cause: com.ibatis.sqlmap.client.SqlMapException: There is no statement named CategoryValue.getCategoryValuesForUserId in this SqlMap.

_________________
Patrick Lightbody
Professional Services
Jive Software
[EMAIL PROTECTED]
www.jivesoftware.com

317 SW Alder, Ste 500
Portland, OR 97204
ph (503) 295-6552
fx (503) 961-1047

Reply via email to