ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: Mapping across namespaces
Date Wed, 07 Sep 2005 17:57:38 GMT
Then you probably didn't set useStatementNamespaces to "true" in the
sqlMapConfig-file...

 

Niels

 

________________________________

From: Patrick Lightbody [mailto:patrick@jivesoftware.com] 
Sent: woensdag 7 september 2005 19:28
To: user-java@ibatis.apache.org
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
patrick@jivesoftware.com
www.jivesoftware.com
317 SW Alder, Ste 500
Portland, OR 97204
ph (503) 295-6552
fx (503) 961-1047 

________________________________

From: Niels Beekman [mailto:n.beekman@wis.nl] 
Sent: Wednesday, September 07, 2005 10:23 AM
To: user-java@ibatis.apache.org
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:patrick@jivesoftware.com] 
Sent: woensdag 7 september 2005 19:18
To: user-java@ibatis.apache.org
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
patrick@jivesoftware.com
www.jivesoftware.com
317 SW Alder, Ste 500
Portland, OR 97204
ph (503) 295-6552
fx (503) 961-1047


Mime
View raw message