How to map mysql point type in java using mybatis
<p>How to map mysql point type in java using mybatis? It is java.lang.Object now.
This is my table:</p>

<pre><code>CREATE TABLE `test` (
  `id` int(11) NOT NULL,
  `location` point DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
</code></pre>

<p>And this is the xml that the generator gives:</p>

<pre><code>  &lt;resultMap id="BaseResultMap" type="package.model.Test"&gt;
    &lt;id column="id" jdbcType="INTEGER" property="id" /&gt;
    &lt;result column="location" jdbcType="OTHER" property="location" /&gt;
  &lt;/resultMap&gt;
  &lt;insert id="insert" parameterType="package.model.Test"&gt;
    insert into test (id, location)
    values (#{id,jdbcType=INTEGER}, #{location,jdbcType=OTHER})
  &lt;/insert&gt;
</code></pre>

<p>I have tried:</p>

<pre><code>public void testPointType() {
    GeometryFactory geometryFactory = new GeometryFactory();
    com.vividsolutions.jts.geom.Point point = geometryFactory.createPoint(new Coordinate(1, 1));
    package.model.Test record = new package.model.Test();
    record.setLocation(point.toText());
    testMapper.insertSelective(record);
}
</code></pre>

<p>But get: <code>com.mysql.jdbc.MysqlDataTruncation: Data truncation: Cannot get geometry object from data you send to the GEOMETRY field</code></p>