title: Check value in MyBatis mapper
body: <p>I have a strange error in a MyBatis mapper where I can check if a parameter is null but I can't check the value of the same parameter;</p>
  
  <p>Here is an excerpt from my mapper:</p>
  
  <pre><code>&lt;parameterMap id="OUTOCriteria" type="Map"&gt;
      &lt;parameter property="name"          javaType="String" /&gt;
      &lt;parameter property="parentOU"      javaType="Long" /&gt;
      &lt;parameter property="type"          javaType="Integer" /&gt;
      &lt;parameter property="statusTypeCurrent" javaType="Integer" /&gt;
  &lt;/parameterMap&gt;
  </code></pre>
  
  <p>Then later I do this check:</p>
  
  <pre><code>&lt;if test="parentOU != null"&gt;
      &lt;if test="parentOU.compareTo(new Long(1))"&gt;
          AND OU_STRC_ID ${parentOU.operator.sql} #{parentOU.value}
      &lt;/if&gt;
  &lt;/if&gt;
  </code></pre>
  
  <p>The first check doesn't throw any error, but the nested check gives me this error:</p>
  
  <pre><code>org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.builder.BuilderException: Error evaluating expression '!parentOU.compareTo(new Long(1))'. Cause: org.apache.ibatis.ognl.MethodFailedException: Method "compareTo" failed for object parentOUEQUAL1 [java.lang.NoSuchMethodException: compareTo(java.lang.Long)] ### The error may exist in com/clearstream/iam/query/sqlmaps/OU.xml ### The error may involve ou.iamouDefaultQuery ### The error occurred while executing a query ### Cause: org.apache.ibatis.builder.BuilderException: Error evaluating expression '!parentOU.compareTo(new Long(1))'. Cause: org.apache.ibatis.ognl.MethodFailedException: Method "compareTo" failed for object parentOUEQUAL1 [java.lang.NoSuchMethodException: compareTo(java.lang.Long)]
  </code></pre>
  
  <p>What would be the correct syntax to test the value of my Long parameter?</p>