Sometimes the code generator makes slight changes to the generated xml, like swapping properties or adding and removing spaces from xml tags. This is irritating as it generates diffs for functionally equivalent code. Jeff Butler mentioned on the mybatis-users mailing list that this was probably due to new files being handled differently from merged files. Here is an example patch:
Index: ../../Documents/new_src/sartre-core/modules/mybatis/src/main/resources/com/nytimes/sartre/mybatis/core_owner/InvoiceAdjustmentMapper.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- ../../Documents/new_src/sartre-core/modules/mybatis/src/main/resources/com/nytimes/sartre/mybatis/core_owner/InvoiceAdjustmentMapper.xml (revision b7090caaecdff0585e3f18d37136ef0fc697db20)
+++ ../../Documents/new_src/sartre-core/modules/mybatis/src/main/resources/com/nytimes/sartre/mybatis/core_owner/InvoiceAdjustmentMapper.xml (revision )
@@ -1,45 +1,45 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustmentMapper" >
+<mapper namespace="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustmentMapper">
- <resultMap id="BaseResultMap" type="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustment" >
+ <resultMap id="BaseResultMap" type="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustment">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
- <id column="ID" property="id" jdbcType="DECIMAL" />
- <result column="INVOICE_ID" property="invoiceId" jdbcType="DECIMAL" />
- <result column="IS_CREDIT" property="isCredit" jdbcType="DECIMAL" />
- <result column="CHARGE_ID" property="chargeId" jdbcType="DECIMAL" />
- <result column="ADJUSTMENT_DATE" property="adjustmentDate" jdbcType="VARCHAR" />
- <result column="CREATE_DATE" property="createDate" jdbcType="TIMESTAMP" />
- <result column="CREATED_BY" property="createdBy" jdbcType="VARCHAR" />
- <result column="INVOICE_ADJUSTMENT_REASON_ID" property="invoiceAdjustmentReasonId" jdbcType="DECIMAL" />
- <result column="UPDATE_DATE" property="updateDate" jdbcType="TIMESTAMP" />
- <result column="UPDATED_BY" property="updatedBy" jdbcType="VARCHAR" />
+ <id column="ID" jdbcType="DECIMAL" property="id" />
+ <result column="INVOICE_ID" jdbcType="DECIMAL" property="invoiceId" />
+ <result column="IS_CREDIT" jdbcType="DECIMAL" property="isCredit" />
+ <result column="CHARGE_ID" jdbcType="DECIMAL" property="chargeId" />
+ <result column="ADJUSTMENT_DATE" jdbcType="VARCHAR" property="adjustmentDate" />
+ <result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate" />
+ <result column="CREATED_BY" jdbcType="VARCHAR" property="createdBy" />
+ <result column="INVOICE_ADJUSTMENT_REASON_ID" jdbcType="DECIMAL" property="invoiceAdjustmentReasonId" />
+ <result column="UPDATE_DATE" jdbcType="TIMESTAMP" property="updateDate" />
+ <result column="UPDATED_BY" jdbcType="VARCHAR" property="updatedBy" />
</resultMap>
- <sql id="Example_Where_Clause" >
+ <sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
- <where >
+ <where>
- <foreach collection="oredCriteria" item="criteria" separator="or" >
+ <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid" >
+ <if test="criteria.valid">
- <trim prefix="(" suffix=")" prefixOverrides="and" >
+ <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion" >
+ <foreach collection="criteria.criteria" item="criterion">
- <choose >
+ <choose>
- <when test="criterion.noValue" >
+ <when test="criterion.noValue">
and ${criterion.condition}
</when>
- <when test="criterion.singleValue" >
+ <when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
- <when test="criterion.betweenValue" >
+ <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
- <when test="criterion.listValue" >
+ <when test="criterion.listValue">
and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+ <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
@@ -50,29 +50,29 @@
</foreach>
</where>
</sql>
- <sql id="Update_By_Example_Where_Clause" >
+ <sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
- <where >
+ <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or" >
+ <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid" >
+ <if test="criteria.valid">
- <trim prefix="(" suffix=")" prefixOverrides="and" >
+ <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion" >
+ <foreach collection="criteria.criteria" item="criterion">
- <choose >
+ <choose>
- <when test="criterion.noValue" >
+ <when test="criterion.noValue">
and ${criterion.condition}
</when>
- <when test="criterion.singleValue" >
+ <when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
- <when test="criterion.betweenValue" >
+ <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
- <when test="criterion.listValue" >
+ <when test="criterion.listValue">
and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+ <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
@@ -83,7 +83,7 @@
</foreach>
</where>
</sql>
- <sql id="Base_Column_List" >
+ <sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
@@ -91,25 +91,25 @@
ID, INVOICE_ID, IS_CREDIT, CHARGE_ID, ADJUSTMENT_DATE, CREATE_DATE, CREATED_BY, INVOICE_ADJUSTMENT_REASON_ID,
UPDATE_DATE, UPDATED_BY
</sql>
- <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustmentExample" >
+ <select id="selectByExample" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustmentExample" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
- <if test="distinct" >
+ <if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from CORE_OWNER.INVOICE_ADJUSTMENT
- <if test="_parameter != null" >
+ <if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
- <if test="orderByClause != null" >
+ <if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.math.BigDecimal" >
+ <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
@@ -119,7 +119,7 @@
from CORE_OWNER.INVOICE_ADJUSTMENT
where ID = #{id,jdbcType=DECIMAL}
</select>
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal" >
+ <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
@@ -127,22 +127,22 @@
delete from CORE_OWNER.INVOICE_ADJUSTMENT
where ID = #{id,jdbcType=DECIMAL}
</delete>
- <delete id="deleteByExample" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustmentExample" >
+ <delete id="deleteByExample" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustmentExample">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from CORE_OWNER.INVOICE_ADJUSTMENT
- <if test="_parameter != null" >
+ <if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
- <insert id="insert" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustment" >
+ <insert id="insert" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustment">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
- <selectKey resultType="java.math.BigDecimal" keyProperty="id" order="BEFORE" >
+ <selectKey keyProperty="id" order="BEFORE" resultType="java.math.BigDecimal">
select core_owner.INV_ADJ_ID_SEQ.nextVal as id from dual
</selectKey>
insert into CORE_OWNER.INVOICE_ADJUSTMENT (ID, INVOICE_ID, IS_CREDIT,
@@ -154,129 +154,129 @@
#{createdBy,jdbcType=VARCHAR}, #{invoiceAdjustmentReasonId,jdbcType=DECIMAL}, #{updateDate,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=VARCHAR})
</insert>
- <insert id="insertSelective" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustment" >
+ <insert id="insertSelective" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustment">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
- <selectKey resultType="java.math.BigDecimal" keyProperty="id" order="BEFORE" >
+ <selectKey keyProperty="id" order="BEFORE" resultType="java.math.BigDecimal">
select core_owner.INV_ADJ_ID_SEQ.nextVal as id from dual
</selectKey>
insert into CORE_OWNER.INVOICE_ADJUSTMENT
- <trim prefix="(" suffix=")" suffixOverrides="," >
+ <trim prefix="(" suffix=")" suffixOverrides=",">
ID,
- <if test="invoiceId != null" >
+ <if test="invoiceId != null">
INVOICE_ID,
</if>
- <if test="isCredit != null" >
+ <if test="isCredit != null">
IS_CREDIT,
</if>
- <if test="chargeId != null" >
+ <if test="chargeId != null">
CHARGE_ID,
</if>
- <if test="adjustmentDate != null" >
+ <if test="adjustmentDate != null">
ADJUSTMENT_DATE,
</if>
- <if test="createDate != null" >
+ <if test="createDate != null">
CREATE_DATE,
</if>
- <if test="createdBy != null" >
+ <if test="createdBy != null">
CREATED_BY,
</if>
- <if test="invoiceAdjustmentReasonId != null" >
+ <if test="invoiceAdjustmentReasonId != null">
INVOICE_ADJUSTMENT_REASON_ID,
</if>
- <if test="updateDate != null" >
+ <if test="updateDate != null">
UPDATE_DATE,
</if>
- <if test="updatedBy != null" >
+ <if test="updatedBy != null">
UPDATED_BY,
</if>
</trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=DECIMAL},
- <if test="invoiceId != null" >
+ <if test="invoiceId != null">
#{invoiceId,jdbcType=DECIMAL},
</if>
- <if test="isCredit != null" >
+ <if test="isCredit != null">
#{isCredit,jdbcType=DECIMAL},
</if>
- <if test="chargeId != null" >
+ <if test="chargeId != null">
#{chargeId,jdbcType=DECIMAL},
</if>
- <if test="adjustmentDate != null" >
+ <if test="adjustmentDate != null">
#{adjustmentDate,jdbcType=VARCHAR},
</if>
- <if test="createDate != null" >
+ <if test="createDate != null">
#{createDate,jdbcType=TIMESTAMP},
</if>
- <if test="createdBy != null" >
+ <if test="createdBy != null">
#{createdBy,jdbcType=VARCHAR},
</if>
- <if test="invoiceAdjustmentReasonId != null" >
+ <if test="invoiceAdjustmentReasonId != null">
#{invoiceAdjustmentReasonId,jdbcType=DECIMAL},
</if>
- <if test="updateDate != null" >
+ <if test="updateDate != null">
#{updateDate,jdbcType=TIMESTAMP},
</if>
- <if test="updatedBy != null" >
+ <if test="updatedBy != null">
#{updatedBy,jdbcType=VARCHAR},
</if>
</trim>
</insert>
- <select id="countByExample" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustmentExample" resultType="java.lang.Integer" >
+ <select id="countByExample" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustmentExample" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from CORE_OWNER.INVOICE_ADJUSTMENT
- <if test="_parameter != null" >
+ <if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
- <update id="updateByExampleSelective" parameterType="map" >
+ <update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update CORE_OWNER.INVOICE_ADJUSTMENT
- <set >
+ <set>
- <if test="record.id != null" >
+ <if test="record.id != null">
ID = #{record.id,jdbcType=DECIMAL},
</if>
- <if test="record.invoiceId != null" >
+ <if test="record.invoiceId != null">
INVOICE_ID = #{record.invoiceId,jdbcType=DECIMAL},
</if>
- <if test="record.isCredit != null" >
+ <if test="record.isCredit != null">
IS_CREDIT = #{record.isCredit,jdbcType=DECIMAL},
</if>
- <if test="record.chargeId != null" >
+ <if test="record.chargeId != null">
CHARGE_ID = #{record.chargeId,jdbcType=DECIMAL},
</if>
- <if test="record.adjustmentDate != null" >
+ <if test="record.adjustmentDate != null">
ADJUSTMENT_DATE = #{record.adjustmentDate,jdbcType=VARCHAR},
</if>
- <if test="record.createDate != null" >
+ <if test="record.createDate != null">
CREATE_DATE = #{record.createDate,jdbcType=TIMESTAMP},
</if>
- <if test="record.createdBy != null" >
+ <if test="record.createdBy != null">
CREATED_BY = #{record.createdBy,jdbcType=VARCHAR},
</if>
- <if test="record.invoiceAdjustmentReasonId != null" >
+ <if test="record.invoiceAdjustmentReasonId != null">
INVOICE_ADJUSTMENT_REASON_ID = #{record.invoiceAdjustmentReasonId,jdbcType=DECIMAL},
</if>
- <if test="record.updateDate != null" >
+ <if test="record.updateDate != null">
UPDATE_DATE = #{record.updateDate,jdbcType=TIMESTAMP},
</if>
- <if test="record.updatedBy != null" >
+ <if test="record.updatedBy != null">
UPDATED_BY = #{record.updatedBy,jdbcType=VARCHAR},
</if>
</set>
- <if test="_parameter != null" >
+ <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
- <update id="updateByExample" parameterType="map" >
+ <update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
@@ -292,48 +292,48 @@
INVOICE_ADJUSTMENT_REASON_ID = #{record.invoiceAdjustmentReasonId,jdbcType=DECIMAL},
UPDATE_DATE = #{record.updateDate,jdbcType=TIMESTAMP},
UPDATED_BY = #{record.updatedBy,jdbcType=VARCHAR}
- <if test="_parameter != null" >
+ <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
- <update id="updateByPrimaryKeySelective" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustment" >
+ <update id="updateByPrimaryKeySelective" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustment">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update CORE_OWNER.INVOICE_ADJUSTMENT
- <set >
+ <set>
- <if test="invoiceId != null" >
+ <if test="invoiceId != null">
INVOICE_ID = #{invoiceId,jdbcType=DECIMAL},
</if>
- <if test="isCredit != null" >
+ <if test="isCredit != null">
IS_CREDIT = #{isCredit,jdbcType=DECIMAL},
</if>
- <if test="chargeId != null" >
+ <if test="chargeId != null">
CHARGE_ID = #{chargeId,jdbcType=DECIMAL},
</if>
- <if test="adjustmentDate != null" >
+ <if test="adjustmentDate != null">
ADJUSTMENT_DATE = #{adjustmentDate,jdbcType=VARCHAR},
</if>
- <if test="createDate != null" >
+ <if test="createDate != null">
CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
</if>
- <if test="createdBy != null" >
+ <if test="createdBy != null">
CREATED_BY = #{createdBy,jdbcType=VARCHAR},
</if>
- <if test="invoiceAdjustmentReasonId != null" >
+ <if test="invoiceAdjustmentReasonId != null">
INVOICE_ADJUSTMENT_REASON_ID = #{invoiceAdjustmentReasonId,jdbcType=DECIMAL},
</if>
- <if test="updateDate != null" >
+ <if test="updateDate != null">
UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP},
</if>
- <if test="updatedBy != null" >
+ <if test="updatedBy != null">
UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
</if>
</set>
where ID = #{id,jdbcType=DECIMAL}
</update>
- <update id="updateByPrimaryKey" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustment" >
+ <update id="updateByPrimaryKey" parameterType="com.nytimes.sartre.mybatis.core_owner.InvoiceAdjustment">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
\ No newline at end of file