Hi,

Is it possible to include an sql segment from another mapper?
In SampleMapper, I've defined columns for sample base class.

<sql id="columns">

Sample.oid AS 'Sample.oid',

Sample.name AS 'Sample.name',

Sample.sampleType AS 'Sample.sampleType',

Sample.userExperimentationOid AS 'Sample.userExperimentationOid',

Sample.userOid AS 'Sample.userOid',

Sample.comments AS 'Sample.comments'

</sql>

I want to include them in mapper of a subclass of Sample

<sql id="columns">

<include refid="ca.qc.ircm.lims.persistence.mapper.SampleMapper.columns"/>,

Sample.oid AS 'Sample.oid',

Control.tag AS 'Control.tag',

Control.support AS 'Control.support',

Control.volume AS 'Control.volume',

Control.quantity AS 'Control.quantity',

Control.quantityUnit AS 'Control.quantityUnit',

Control.standard AS 'Control.standard'

</sql>

But it gives me an exception

nested exception is org.apache.ibatis.builder.BuilderException: Error parsing 
SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing 
Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Could not find 
SQL statement to include with refid 
'ca.qc.ircm.lims.persistence.mapper.SampleMapper.columns'

Since my Sample class has many subclasses, I don't want to write the same 
column names again and again...

Thanks.
Christian

Reply via email to