title: mybatis IllegalArgumentException: Mapped Statements collection does not contain value
body: <p>i have many problem with spring e mybatis. This is my spring configuration:
  i have the same configuration and ComuneMapper.java and ComuneMapper.xml stay in the same folders. but i have however this error
  Somebody to help meeeee</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans
      xmlns="http://www.springframework.org/schema/beans"
      xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:webflow="http://www.springframework.org/schema/webflow-config"
      xmlns:util="http://www.springframework.org/schema/util"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:mvc="http://www.springframework.org/schema/mvc"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
          http://www.springframework.org/schema/aop
          http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context-2.5.xsd
          http://www.springframework.org/schema/webflow-config
          http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd
          http://www.springframework.org/schema/util
          http://www.springframework.org/schema/util/spring-util-2.0.xsd
          http://www.springframework.org/schema/mvc
          http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&gt;
  
      &lt;context:annotation-config /&gt; 
  
      &lt;!-- Scans the classpath of this application for @Components to deploy as beans --&gt;
      &lt;context:component-scan
          base-package="com.aieap" /&gt;
  
      &lt;!-- Configures the @Controller programming model --&gt;
      &lt;mvc:annotation-driven /&gt;
  
  
      &lt;!-- Configurazione Spring MVC View Resolver --&gt;
      &lt;bean
          id="viewResolver"
          class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property
              name="viewClass"
              value="org.springframework.web.servlet.view.JstlView" /&gt;
          &lt;property
              name="prefix"
              value="/jsp/" /&gt;
          &lt;property
              name="suffix"
              value=".jsp" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- Flow Handler Adapter --&gt;
      &lt;bean
          class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter"&gt;
          &lt;property
              name="flowExecutor"
              ref="flowExecutor" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- Flow Handler Mapping --&gt;
      &lt;bean
          class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping"&gt;
          &lt;property
              name="flowRegistry"
              ref="flowRegistry" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- Flow Executor --&gt;
      &lt;webflow:flow-executor
          id="flowExecutor" /&gt;
  
      &lt;!-- Flow Registry --&gt;
      &lt;webflow:flow-registry
          id="flowRegistry"
          flow-builder-services="flowBuilderServices"&gt;
          &lt;!-- nonaut --&gt;
          &lt;webflow:flow-location
              id="home-nonaut"
              path="/WEB-INF/flows/nonaut/home-nonaut.xml" /&gt;
          &lt;webflow:flow-location
              id="logout"
              path="/WEB-INF/flows/nonaut/logout.xml" /&gt;
  
          &lt;!-- aut --&gt;
          &lt;webflow:flow-location
              id="aut/home-aut"
              path="/WEB-INF/flows/aut/home-aut.xml" /&gt;
          &lt;webflow:flow-location
              id="aut/nuova-domanda"
              path="/WEB-INF/flows/aut/nuova-domanda.xml" /&gt;
          &lt;webflow:flow-location
              id="aut/invia-domanda"
              path="/WEB-INF/flows/aut/invia-domanda.xml" /&gt;
          &lt;webflow:flow-location
              id="aut/nuovo-operatore-rer"
              path="/WEB-INF/flows/aut/nuovo-operatore-rer.xml" /&gt;
  
      &lt;/webflow:flow-registry&gt;
  
      &lt;webflow:flow-builder-services
          id="flowBuilderServices"
          view-factory-creator="viewFactoryCreator" /&gt;
  
      &lt;bean
          id="viewFactoryCreator"
          class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator"&gt;
          &lt;property
              name="viewResolvers"&gt;
              &lt;list&gt;
                  &lt;ref
                      bean="viewResolver" /&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property
              name="useSpringBeanBinding"
              value="true" /&gt;
      &lt;/bean&gt;
  
      &lt;import resource="jdbc-context.xml" /&gt;
  
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>jdbc-context.xm:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans
      xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:p="http://www.springframework.org/schema/p"
      xmlns:tx="http://www.springframework.org/schema/tx"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="
              http://www.springframework.org/schema/beans 
              http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
              http://www.springframework.org/schema/tx 
              http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
              http://www.springframework.org/schema/context
              http://www.springframework.org/schema/context/spring-context-3.0.xsd
              "&gt;
  
      &lt;context:property-placeholder
          location="/WEB-INF/db.properties" /&gt;
  
      &lt;!-- Enable annotation style of managing transactions --&gt;
      &lt;tx:annotation-driven
          transaction-manager="transactionManager" /&gt;
  
      &lt;!-- Declare a datasource that has pooling capabilities --&gt;
      &lt;bean
          id="dataSource"
          class="com.mchange.v2.c3p0.ComboPooledDataSource"
          destroy-method="close"
          p:driverClass="${jdbc.driver}"
          p:jdbcUrl="${jdbc.url}"
          p:user="${jdbc.username}"
          p:password="$jdbc.password}"
          p:acquireIncrement="10"
          p:idleConnectionTestPeriod="60"
          p:maxPoolSize="100"
          p:maxStatements="50"
          p:minPoolSize="10" /&gt;
  
      &lt;!-- Declare a transaction manager --&gt;
      &lt;bean
          id="transactionManager"
          class="org.springframework.jdbc.datasource.DataSourceTransactionManager"
          p:dataSource-ref="dataSource" /&gt;
  
  
      &lt;!-- define the SqlSessionFactory, notice that configLocation is not needed when you use MapperFactoryBean --&gt;
      &lt;bean
          id="sqlSessionFactory"
          class="org.mybatis.spring.SqlSessionFactoryBean"&gt;
          &lt;property
              name="dataSource"
              ref="dataSource" /&gt;
          &lt;property
              name="configLocation"
              value="WEB-INF/mybatis/sqlmap-config.xml" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- scan for mappers and will automatically scan the whole classpath for xmls --&gt;
      &lt;bean
          class="org.mybatis.spring.mapper.MapperScannerConfigurer"&gt;
          &lt;property name="sqlSessionFactory" ref="sqlSessionFactory" /&gt;
          &lt;property name="basePackage" value="com.aieap.dao.mapper" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>sqlmap-config.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE configuration
      PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
      "http://mybatis.org/dtd/mybatis-3-config.dtd"&gt;
  
  &lt;configuration&gt;
      &lt;settings&gt;
          &lt;!-- changes from the defaults --&gt;
          &lt;setting name="lazyLoadingEnabled" value="false" /&gt;
      &lt;/settings&gt;
      &lt;typeAliases&gt;
          &lt;typeAlias type="com.aieap.model.Comuni" alias="comuni"/&gt;
      &lt;/typeAliases&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>controller:</p>
  
  <pre><code>package com.aieap.web.controller;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.ModelMap;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.apache.log4j.Logger;
  
  import com.aieap.dao.mapper.ComuniMapper;
  import com.aieap.model.Comuni;
  import com.aieap.model.OperatoriRer;
  
  @Controller
  public class OperatoriRerController {
  
      @Autowired ComuniMapper comuniDao;
  
  
      private static final Logger logger = Logger.getLogger(OperatoriRerController.class);
  
  
  
       @RequestMapping("/aut/nuovo-operatore-rer")
          public ModelMap start() {
  
          Comuni comuni = comuniDao.selectByPrimaryKey(new Long(1));
          System.out.print(comuni);
          OperatoriRer op = new OperatoriRer();
          op.setNome("ciccio");
          op.setCognome("cappuccio");
          ModelMap model = new ModelMap();
          model.addAttribute("OperatoriRer",op);
          return model;
          }
  
  
       @RequestMapping("/aut/search-comune")
          public ModelMap searchcomune() {
          List&lt;Comuni&gt; comuniList = new ArrayList &lt;Comuni&gt;() ;        
          ModelMap model = new ModelMap();
          model.addAttribute("ComunuList",comuniList);
          return model;
          }
  }
  </code></pre>
  
  <p>this is the error:</p>
  
  <pre><code>GRAVE: Servlet.service() for servlet [dispatch] in context with path [/aieap] threw exception [Request processing failed; nested exception is java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.aieap.dao.mapper.ComuniMapper.selectByPrimaryKey] with root cause
  java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.aieap.dao.mapper.ComuniMapper.selectByPrimaryKey
      at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:593)
      at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:393)
      at org.apache.ibatis.binding.MapperMethod.setupCommandType(MapperMethod.java:160)
      at org.apache.ibatis.binding.MapperMethod.&lt;init&gt;(MapperMethod.java:48)
      at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:37)
      at $Proxy9.selectByPrimaryKey(Unknown Source)
      at com.aieap.web.controller.OperatoriRerController.start(OperatoriRerController.java:29)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
      at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
      at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:746)
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:687)
      at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:811)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:796)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:182)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
  </code></pre>
  
  <p>please!!! someone help me I'm hopeless!!!!!!!!!!!!!!!</p>
  
  <p>I had forgotten.
  this is ComuniMapper.java</p>
  
  <pre><code>package com.aieap.dao.mapper;
  
  import com.aieap.model.Comuni;
  import com.aieap.model.ComuniExample;
  import java.util.List;
  import org.apache.ibatis.annotations.Param;
  
  public interface ComuniMapper {
  
      int countByExample(ComuniExample example);
      int deleteByExample(ComuniExample example);
      int deleteByPrimaryKey(Long idComune);
      int insert(Comuni record);
      int insertSelective(Comuni record);
      List&lt;Comuni&gt; selectByExample(ComuniExample example);
      Comuni selectByPrimaryKey(Long idComune);
  
      /**
       * This method was generated by MyBatis Generator.
       * This method corresponds to the database table comuni
       *
       * @mbggenerated Tue Jan 08 16:52:16 CET 2013
       */
      int updateByExampleSelective(@Param("record") Comuni record, @Param("example") ComuniExample example);
  
      /**
       * This method was generated by MyBatis Generator.
       * This method corresponds to the database table comuni
       *
       * @mbggenerated Tue Jan 08 16:52:16 CET 2013
       */
      int updateByExample(@Param("record") Comuni record, @Param("example") ComuniExample example);
  
      /**
       * This method was generated by MyBatis Generator.
       * This method corresponds to the database table comuni
       *
       * @mbggenerated Tue Jan 08 16:52:16 CET 2013
       */
      int updateByPrimaryKeySelective(Comuni record);
  
      /**
       * This method was generated by MyBatis Generator.
       * This method corresponds to the database table comuni
       *
       * @mbggenerated Tue Jan 08 16:52:16 CET 2013
       */
      int updateByPrimaryKey(Comuni record);
  }
  </code></pre>
  
  <p>end this ComuniMapper.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" &gt;
  &lt;mapper namespace="com.aieap.dao.mapper.ComuniMapper" &gt;
    &lt;resultMap id="BaseResultMap" type="com.aieap.model.Comuni" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      &lt;id column="ID_COMUNE" property="idComune" jdbcType="BIGINT" /&gt;
      &lt;result column="CODICE_ISTAT" property="codiceIstat" jdbcType="VARCHAR" /&gt;
      &lt;result column="DESCRIZIONE" property="descrizione" jdbcType="VARCHAR" /&gt;
      &lt;result column="CAP" property="cap" jdbcType="VARCHAR" /&gt;
      &lt;result column="CODICE_PROVINCIA" property="codiceProvincia" jdbcType="BIGINT" /&gt;
      &lt;result column="COMUNE_SIGLA" property="comuneSigla" jdbcType="VARCHAR" /&gt;
      &lt;result column="COMUNE_CFIS" property="comuneCfis" jdbcType="VARCHAR" /&gt;
    &lt;/resultMap&gt;
    &lt;sql id="Example_Where_Clause" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      &lt;where &gt;
        &lt;foreach collection="oredCriteria" item="criteria" separator="or" &gt;
          &lt;if test="criteria.valid" &gt;
            &lt;trim prefix="(" suffix=")" prefixOverrides="and" &gt;
              &lt;foreach collection="criteria.criteria" item="criterion" &gt;
                &lt;choose &gt;
                  &lt;when test="criterion.noValue" &gt;
                    and ${criterion.condition}
                  &lt;/when&gt;
                  &lt;when test="criterion.singleValue" &gt;
                    and ${criterion.condition} #{criterion.value}
                  &lt;/when&gt;
                  &lt;when test="criterion.betweenValue" &gt;
                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                  &lt;/when&gt;
                  &lt;when test="criterion.listValue" &gt;
                    and ${criterion.condition}
                    &lt;foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," &gt;
                      #{listItem}
                    &lt;/foreach&gt;
                  &lt;/when&gt;
                &lt;/choose&gt;
              &lt;/foreach&gt;
            &lt;/trim&gt;
          &lt;/if&gt;
        &lt;/foreach&gt;
      &lt;/where&gt;
    &lt;/sql&gt;
    &lt;sql id="Update_By_Example_Where_Clause" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      &lt;where &gt;
        &lt;foreach collection="example.oredCriteria" item="criteria" separator="or" &gt;
          &lt;if test="criteria.valid" &gt;
            &lt;trim prefix="(" suffix=")" prefixOverrides="and" &gt;
              &lt;foreach collection="criteria.criteria" item="criterion" &gt;
                &lt;choose &gt;
                  &lt;when test="criterion.noValue" &gt;
                    and ${criterion.condition}
                  &lt;/when&gt;
                  &lt;when test="criterion.singleValue" &gt;
                    and ${criterion.condition} #{criterion.value}
                  &lt;/when&gt;
                  &lt;when test="criterion.betweenValue" &gt;
                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                  &lt;/when&gt;
                  &lt;when test="criterion.listValue" &gt;
                    and ${criterion.condition}
                    &lt;foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," &gt;
                      #{listItem}
                    &lt;/foreach&gt;
                  &lt;/when&gt;
                &lt;/choose&gt;
              &lt;/foreach&gt;
            &lt;/trim&gt;
          &lt;/if&gt;
        &lt;/foreach&gt;
      &lt;/where&gt;
    &lt;/sql&gt;
    &lt;sql id="Base_Column_List" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      ID_COMUNE, CODICE_ISTAT, DESCRIZIONE, CAP, CODICE_PROVINCIA, COMUNE_SIGLA, COMUNE_CFIS
    &lt;/sql&gt;
    &lt;select id="selectByExample" resultMap="BaseResultMap" parameterType="com.aieap.model.ComuniExample" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      select
      &lt;if test="distinct" &gt;
        distinct
      &lt;/if&gt;
      &lt;include refid="Base_Column_List" /&gt;
      from comuni
      &lt;if test="_parameter != null" &gt;
        &lt;include refid="Example_Where_Clause" /&gt;
      &lt;/if&gt;
      &lt;if test="orderByClause != null" &gt;
        order by ${orderByClause}
      &lt;/if&gt;
    &lt;/select&gt;
    &lt;select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      select 
      &lt;include refid="Base_Column_List" /&gt;
      from comuni
      where ID_COMUNE = #{idComune,jdbcType=BIGINT}
    &lt;/select&gt;
    &lt;delete id="deleteByPrimaryKey" parameterType="java.lang.Long" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      delete from comuni
      where ID_COMUNE = #{idComune,jdbcType=BIGINT}
    &lt;/delete&gt;
    &lt;delete id="deleteByExample" parameterType="com.aieap.model.ComuniExample" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      delete from comuni
      &lt;if test="_parameter != null" &gt;
        &lt;include refid="Example_Where_Clause" /&gt;
      &lt;/if&gt;
    &lt;/delete&gt;
    &lt;insert id="insert" parameterType="com.aieap.model.Comuni" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      insert into comuni (ID_COMUNE, CODICE_ISTAT, DESCRIZIONE, 
        CAP, CODICE_PROVINCIA, COMUNE_SIGLA, 
        COMUNE_CFIS)
      values (#{idComune,jdbcType=BIGINT}, #{codiceIstat,jdbcType=VARCHAR}, #{descrizione,jdbcType=VARCHAR}, 
        #{cap,jdbcType=VARCHAR}, #{codiceProvincia,jdbcType=BIGINT}, #{comuneSigla,jdbcType=VARCHAR}, 
        #{comuneCfis,jdbcType=VARCHAR})
    &lt;/insert&gt;
    &lt;insert id="insertSelective" parameterType="com.aieap.model.Comuni" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      insert into comuni
      &lt;trim prefix="(" suffix=")" suffixOverrides="," &gt;
        &lt;if test="idComune != null" &gt;
          ID_COMUNE,
        &lt;/if&gt;
        &lt;if test="codiceIstat != null" &gt;
          CODICE_ISTAT,
        &lt;/if&gt;
        &lt;if test="descrizione != null" &gt;
          DESCRIZIONE,
        &lt;/if&gt;
        &lt;if test="cap != null" &gt;
          CAP,
        &lt;/if&gt;
        &lt;if test="codiceProvincia != null" &gt;
          CODICE_PROVINCIA,
        &lt;/if&gt;
        &lt;if test="comuneSigla != null" &gt;
          COMUNE_SIGLA,
        &lt;/if&gt;
        &lt;if test="comuneCfis != null" &gt;
          COMUNE_CFIS,
        &lt;/if&gt;
      &lt;/trim&gt;
      &lt;trim prefix="values (" suffix=")" suffixOverrides="," &gt;
        &lt;if test="idComune != null" &gt;
          #{idComune,jdbcType=BIGINT},
        &lt;/if&gt;
        &lt;if test="codiceIstat != null" &gt;
          #{codiceIstat,jdbcType=VARCHAR},
        &lt;/if&gt;
        &lt;if test="descrizione != null" &gt;
          #{descrizione,jdbcType=VARCHAR},
        &lt;/if&gt;
        &lt;if test="cap != null" &gt;
          #{cap,jdbcType=VARCHAR},
        &lt;/if&gt;
        &lt;if test="codiceProvincia != null" &gt;
          #{codiceProvincia,jdbcType=BIGINT},
        &lt;/if&gt;
        &lt;if test="comuneSigla != null" &gt;
          #{comuneSigla,jdbcType=VARCHAR},
        &lt;/if&gt;
        &lt;if test="comuneCfis != null" &gt;
          #{comuneCfis,jdbcType=VARCHAR},
        &lt;/if&gt;
      &lt;/trim&gt;
    &lt;/insert&gt;
    &lt;select id="countByExample" parameterType="com.aieap.model.ComuniExample" resultType="java.lang.Integer" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      select count(*) from comuni
      &lt;if test="_parameter != null" &gt;
        &lt;include refid="Example_Where_Clause" /&gt;
      &lt;/if&gt;
    &lt;/select&gt;
    &lt;update id="updateByExampleSelective" parameterType="map" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      update comuni
      &lt;set &gt;
        &lt;if test="record.idComune != null" &gt;
          ID_COMUNE = #{record.idComune,jdbcType=BIGINT},
        &lt;/if&gt;
        &lt;if test="record.codiceIstat != null" &gt;
          CODICE_ISTAT = #{record.codiceIstat,jdbcType=VARCHAR},
        &lt;/if&gt;
        &lt;if test="record.descrizione != null" &gt;
          DESCRIZIONE = #{record.descrizione,jdbcType=VARCHAR},
        &lt;/if&gt;
        &lt;if test="record.cap != null" &gt;
          CAP = #{record.cap,jdbcType=VARCHAR},
        &lt;/if&gt;
        &lt;if test="record.codiceProvincia != null" &gt;
          CODICE_PROVINCIA = #{record.codiceProvincia,jdbcType=BIGINT},
        &lt;/if&gt;
        &lt;if test="record.comuneSigla != null" &gt;
          COMUNE_SIGLA = #{record.comuneSigla,jdbcType=VARCHAR},
        &lt;/if&gt;
        &lt;if test="record.comuneCfis != null" &gt;
          COMUNE_CFIS = #{record.comuneCfis,jdbcType=VARCHAR},
        &lt;/if&gt;
      &lt;/set&gt;
      &lt;if test="_parameter != null" &gt;
        &lt;include refid="Update_By_Example_Where_Clause" /&gt;
      &lt;/if&gt;
    &lt;/update&gt;
    &lt;update id="updateByExample" parameterType="map" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      update comuni
      set ID_COMUNE = #{record.idComune,jdbcType=BIGINT},
        CODICE_ISTAT = #{record.codiceIstat,jdbcType=VARCHAR},
        DESCRIZIONE = #{record.descrizione,jdbcType=VARCHAR},
        CAP = #{record.cap,jdbcType=VARCHAR},
        CODICE_PROVINCIA = #{record.codiceProvincia,jdbcType=BIGINT},
        COMUNE_SIGLA = #{record.comuneSigla,jdbcType=VARCHAR},
        COMUNE_CFIS = #{record.comuneCfis,jdbcType=VARCHAR}
      &lt;if test="_parameter != null" &gt;
        &lt;include refid="Update_By_Example_Where_Clause" /&gt;
      &lt;/if&gt;
    &lt;/update&gt;
    &lt;update id="updateByPrimaryKeySelective" parameterType="com.aieap.model.Comuni" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      update comuni
      &lt;set &gt;
        &lt;if test="codiceIstat != null" &gt;
          CODICE_ISTAT = #{codiceIstat,jdbcType=VARCHAR},
        &lt;/if&gt;
        &lt;if test="descrizione != null" &gt;
          DESCRIZIONE = #{descrizione,jdbcType=VARCHAR},
        &lt;/if&gt;
        &lt;if test="cap != null" &gt;
          CAP = #{cap,jdbcType=VARCHAR},
        &lt;/if&gt;
        &lt;if test="codiceProvincia != null" &gt;
          CODICE_PROVINCIA = #{codiceProvincia,jdbcType=BIGINT},
        &lt;/if&gt;
        &lt;if test="comuneSigla != null" &gt;
          COMUNE_SIGLA = #{comuneSigla,jdbcType=VARCHAR},
        &lt;/if&gt;
        &lt;if test="comuneCfis != null" &gt;
          COMUNE_CFIS = #{comuneCfis,jdbcType=VARCHAR},
        &lt;/if&gt;
      &lt;/set&gt;
      where ID_COMUNE = #{idComune,jdbcType=BIGINT}
    &lt;/update&gt;
    &lt;update id="updateByPrimaryKey" parameterType="com.aieap.model.Comuni" &gt;
      &lt;!--
        WARNING - @mbggenerated
        This element is automatically generated by MyBatis Generator, do not modify.
        This element was generated on Tue Jan 08 16:52:16 CET 2013.
      --&gt;
      update comuni
      set CODICE_ISTAT = #{codiceIstat,jdbcType=VARCHAR},
        DESCRIZIONE = #{descrizione,jdbcType=VARCHAR},
        CAP = #{cap,jdbcType=VARCHAR},
        CODICE_PROVINCIA = #{codiceProvincia,jdbcType=BIGINT},
        COMUNE_SIGLA = #{comuneSigla,jdbcType=VARCHAR},
        COMUNE_CFIS = #{comuneCfis,jdbcType=VARCHAR}
      where ID_COMUNE = #{idComune,jdbcType=BIGINT}
    &lt;/update&gt;
  &lt;/mapper&gt;
  </code></pre>