tags:

views:

12

answers:

1

Hi Guys, I've got a sql fragments defined in a particular namespace like:

<sqlMap namespace="firstNamespace">
   .....
   <sql id="fragmentOne">

and then from another namespace I'm trying to use it, but seems that IBatis is not able to find it.

Could not find SQL statement to include with refid 'firstNamespace.fragmentOne'

Now I know that the loading order is important, so the SqlMapConfig.xml file I place the xml file containing the fragment first, but no results.

Do you have any idea on how to use a sql fragment from another namespace?

Thanks Roberto

A: 

Have you enabled namespaces?

<sqlMapConfig>

  <settings useStatementNamespaces="true"/>

Reference:

http://java.ociweb.com/mark/programming/iBATIS.html

JoseK