Hello,

 

Is there any way to divide a sqlMapConfig file into several separate files for different configurations.

 

For example in our setup we are using a number of common SQL statements. In addition, we have several specific setups with specialized statements for each setup. We would like to include the common sqlMap statements into each specific config file together with the specific statements.

 

To achieve this we tried to use the <sqlMap resource="commonConfig.xml"/>.

There was no problem reported from the SqlMapClientBuilder but the included statements were not found, resulting in an exception like this:

 

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

at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(SqlMapExecutorDelegate.java:287)

at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:617)

at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:598)

at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:107)

at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:76)

...

 

The file commonConfig is a regular sqlMapConfig XML file with only sqlMap tags. Including these tags directly in the main sqlMapConfig file presents no problems but is not very maintenance friendly due to the duplicate of information.

 

We also tried using external parsed entities but this resulted in problems finding the resources due to no base URI set. With absolute paths in the URL there was no problem but this is not a solution that is possible in our situation.

 

Thanks for any input in this matter.

 

Best regards

/Matilda

Reply via email to