Hi all,

I'm using Abator (0.6.5) to generate the models, SQL maps and Spring-based DAO's for my database connection based on iBATIS (2.1.7).

The sql maps that abator generates have unique namespaces, for example:

<sqlMap namespace="country">
        ...
        <select id="abatorgenerated_selectByPrimaryKey" ...
        ...
</sqlMap>

The spring-based dao's that abator generates contain references to operations defined in the sql maps like this:

getSqlMapClientTemplate().queryForObject("country.abatorgenerated_selectByPrimaryKey", key);

(the getSqlMapClientTemplate() method is implemented in the spring framework, I'm using Spring 1.2.8)

If I'm using a dao like this:

CountryDAO countryDAO = (CountryDAO)context.getBean("countryDAO");
Country country = countryDAO.selectByPrimaryKey(key);

I'm getting the following exception:

com.ibatis.sqlmap.client.SqlMapException: There is no statement named countries.abatorgenerated_selectByPrimaryKey in this SqlMap.

It looks like iBATIS ignores the namespace definition in the sql map, because everything works fine if I change the call in the dao to:

getSqlMapClientTemplate().queryForObject("abatorgenerated_selectByPrimaryKey", key);

I'm only using iBATIS & abator for two days now, so if I supplied the wrong or insufficient/confusing info please let me know.

Thanks in advance, Rob

Reply via email to