title: Why I can't retrieve a database field havin "point" as data type using Hibernate5\Spring Data JPA into this Spring Boot project?
body: <p>I am working on a <strong>Spring Boot</strong> project and I am going crazy trying to correctly map a <strong>point</strong> field of a MySql DB (it is MariaDB but it is the same thing...).</p>
  
  <p>To retrieve data I am using <strong>Spring Data JPA</strong> on <strong>Hibernate 5</strong>.</p>
  
  <p>I have this accomodation table on my DB:</p>
  
  <pre><code>Field                           Type                            Null            Key             Default             Extra   
  id                              bigint(20) unsigned             NO              PRI             NULL                auto_increment
  user_id                         bigint(20) unsigned             NO              MUL             NULL    
  accomodation_name               varchar(255)                    NO              NULL    
  description                     text                            NO              NULL    
  nation                          varchar(255)                    NO              NULL    
  region                          varchar(255)                    NO              NULL    
  province                        varchar(255)                    NO              NULL    
  city                            varchar(255)                    NO              NULL    
  geographical_position           point                           NO              NULL    
  stars                           int(10)                         NO              NULL    
  accomodation_typological_id     bigint(20) unsigned             YES             NULL    
  accomodation_service_id         bigint(20) unsigned             YES             NULL    
  phone                           varchar(255)                    YES             NULL    
  mobile                          varchar(255)                    YES             NULL    
  fax                             varchar(255)                    YES             NULL    
  email                           varchar(255)                    YES             NULL    
  time_stamp                      datetime                        YES             NULL    
  </code></pre>
  
  <p>As you can see this table contain the field <strong>geographical_position</strong> having <strong>point</strong> as data type (beloning to MySql opengGIS implementation).</p>
  
  <p>The previous table is mapped by this Accomodation class:</p>
  
  <pre><code>import com.vividsolutions.jts.geom.Point;
  import org.hibernate.annotations.Type;
  
  import javax.persistence.*;
  import java.io.Serializable;
  import java.math.BigInteger;
  import java.util.List;
  
  /**
   * Created by Yngve on 30/09/16.
   */
  @Entity
  @Table(name = "accomodation")
  public class Accomodation implements Serializable {
  
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "id")
      private Long id;
  
      /*@ManyToOne
      private Users users;
      */
  
      @OneToMany(mappedBy = "accomodation")
      private List&lt;Room&gt; rooms;
  
      @Column(name = "accomodation_name")
      private String name;
  
      @Column(name = "description")
      @Type(type="text")
      private String description;
      private String phone;
      private String mobile;
      private String fax;
      private String email;
      private Integer stars;
  
      @Column(name = "geographical_position", columnDefinition="Point")
      private Point location;
  
  
      public Accomodation(){
  
      }
  
      // GETTER AND SETTER METHODS
  }
  </code></pre>
  
  <p>As you can see the previous point field on the table is mapped by this field on my Java class:</p>
  
  <pre><code>@Column(name = "geographical_position", columnDefinition="Point")
  private Point location;
  </code></pre>
  
  <p>In the previous code snippet I have also inserted the import of the used implementation of Point is provided by (I found it on some tutorial):</p>
  
  <pre><code>import com.vividsolutions.jts.geom.Point;
  </code></pre>
  
  <p>But I am absolutly not sure that this is the correct class that have to be used.</p>
  
  <p>This is my DAO class the implement the Spring Data JPA query (the query is generated by Spring Data JPA using the method signature):</p>
  
  <pre><code>@Repository
  @Transactional(propagation = Propagation.MANDATORY)
  public interface AccomodationDAO extends JpaRepository&lt;Accomodation, Long&gt; {
  
      //@Query("FROM Accomodation WHERE id = :id")
      Accomodation findById(@Param("id") Long id);
  }
  </code></pre>
  
  <p>The problem is that testing the previous DAO method using this <strong>JUnuit</strong> test method:</p>
  
  <pre><code>@Test
  public void placeSearcherControllerTest() {
      System.out.println("placeSearcherControllerTest START");
  
      Accomodation accomodation = accomodationDAO.findById(6L);
  
      System.out.println("placeSearcherControllerTest END");
  }
  </code></pre>
  
  <p>I obtain the following error message in the IntelliJ console:</p>
  
  <pre><code>Hibernate: select accomodati0_.id as id1_0_, accomodati0_.description as descript2_0_, accomodati0_.email as email3_0_, accomodati0_.fax as fax4_0_, accomodati0_.geographical_position as geograph5_0_, accomodati0_.mobile as mobile6_0_, accomodati0_.accomodation_name as accomoda7_0_, accomodati0_.phone as phone8_0_, accomodati0_.stars as stars9_0_ from accomodation accomodati0_ where accomodati0_.id=?
  
  org.springframework.orm.jpa.JpaSystemException: could not deserialize; nested exception is org.hibernate.type.SerializationException: could not deserialize
  
      at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:333)
      at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244)
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:491)
      at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
      at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
      at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
      at com.sun.proxy.$Proxy112.findById(Unknown Source)
      at com.betriuvis.controller.test.PlaceSearcherControllerTest.placeSearcherControllerTest(PlaceSearcherControllerTest.java:58)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
      at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
      at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
      at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
      at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
      at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)
  Caused by: org.hibernate.type.SerializationException: could not deserialize
      at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:243)
      at org.hibernate.internal.util.SerializationHelper.deserialize(SerializationHelper.java:287)
      at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.fromBytes(SerializableTypeDescriptor.java:138)
      at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:113)
      at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:27)
      at org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDescriptor.java:60)
      at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:47)
      at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:238)
      at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:234)
      at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:224)
      at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:300)
      at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2738)
      at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1729)
      at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1655)
      at org.hibernate.loader.Loader.getRow(Loader.java:1544)
      at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:727)
      at org.hibernate.loader.Loader.processResultSet(Loader.java:972)
      at org.hibernate.loader.Loader.doQuery(Loader.java:930)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336)
      at org.hibernate.loader.Loader.doList(Loader.java:2617)
      at org.hibernate.loader.Loader.doList(Loader.java:2600)
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2429)
      at org.hibernate.loader.Loader.list(Loader.java:2424)
      at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501)
      at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371)
      at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)
      at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1326)
      at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87)
      at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)
      at org.hibernate.jpa.internal.QueryImpl.getSingleResult(QueryImpl.java:529)
      at org.hibernate.jpa.criteria.compile.CriteriaQueryTypeQueryAdapter.getSingleResult(CriteriaQueryTypeQueryAdapter.java:54)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:372)
      at com.sun.proxy.$Proxy119.getSingleResult(Unknown Source)
      at org.springframework.data.jpa.repository.query.JpaQueryExecution$SingleEntityExecution.doExecute(JpaQueryExecution.java:210)
      at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:82)
      at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:114)
      at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:104)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:482)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:460)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
      at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
      ... 36 more
  Caused by: java.io.StreamCorruptedException: invalid stream header: 00000000
      at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:806)
      at java.io.ObjectInputStream.&lt;init&gt;(ObjectInputStream.java:299)
      at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.&lt;init&gt;(SerializationHelper.java:309)
      at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.&lt;init&gt;(SerializationHelper.java:299)
      at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:218)
      ... 86 more
  </code></pre>
  
  <p>The problem is certainly caused by this mapping on the <strong>Accomodation</strong> class:</p>
  
  <pre><code>@Column(name = "geographical_position", columnDefinition="Point")
  private Point location;
  </code></pre>
  
  <p>because if I delete this field from my entity class I have no exception and I correctly retrieve the <strong>Accomodation</strong> object (that not contains the location field).</p>
  
  <p>Looking at the previous error output I can see that Hibernate generate this SQL query:</p>
  
  <pre><code>select accomodati0_.id as id1_0_, accomodati0_.description as descript2_0_, accomodati0_.email as email3_0_, accomodati0_.fax as fax4_0_, accomodati0_.geographical_position as geograph5_0_, accomodati0_.mobile as mobile6_0_, accomodati0_.accomodation_name as accomoda7_0_, accomodati0_.phone as phone8_0_, accomodati0_.stars as stars9_0_ from accomodation accomodati0_ where accomodati0_.id=6 
  </code></pre>
  
  <p>that performed directly on my database I obtain the correct record. As content of the previous <strong>point</strong> field I can see this value <strong>[GEOMETRY - 25 B]</strong> (what means <strong>25 B</strong>?) that downloaded is a file named accomodation-<strong>geographical_position.bin</strong>.</p>
  
  <p>Performing this other query on the DB: </p>
  
  <pre><code>select id, AsText(geographical_position) from accomodation where id = 6 
  </code></pre>
  
  <p>I correctly obtatin the coordinates contained in my <strong>geographical_position</strong> field, infact this i the obtained query output:</p>
  
  <pre><code>id      AsText(geographical_position)
  --------------------------------------
  6       POINT(41.729086 12.278478)
  </code></pre>
  
  <p>So the data is correctly stored into the <strong>geographical_position</strong> having <strong>point</strong> as data type.</p>
  
  <p>So the problem is related to the mapping of the <strong>geographical_position</strong> field to the <strong>Point location</strong> of my entity class.</p>
  
  <p>Searching on stackoverflow it seems to me that the <strong>org.hibernate.type.SerializationException: could not deserialize</strong> exception something happing when Hibernate can't put the value of a field into a specific Java object so I am having some doubt related the <strong>import com.vividsolutions.jts.geom.Point</strong> used class to map the <strong>point</strong> database field (maybe is this a class used on the old version of Hibrnate Spatial or something like this?)</p>
  
  <p>Or maybe it could be a <strong>Spring Boot</strong> configuration problem, so I put here also my <strong>appliction.properties</strong> file representing my entire application configuration:</p>
  
  <pre><code>#No auth  protected
  endpoints.shutdown.sensitive=true
  #Enable shutdown endpoint
  endpoints.shutdown.enabled=true
  logging.file=BeTriviusController.log
  logging.level.org.springframework.web=DEBUG
  logging.level.org.hibernate=ERROR
  
  # Thymeleaf
  spring.thymeleaf.cache:false
  
  
  # DATABASE CONFIG ----------------------------------------------------------------------------------------------------
  spring.datasource.url = jdbc:mysql://localhost:3306/betriviustest
  spring.datasource.username = root
  spring.datasource.password =
  spring.datasource.driver-class-name = com.mysql.jdbc.Driver
  spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate4.SpringSessionContext
  
  spring.datasource.testWhileIdle = true
  spring.datasource.validationQuery = SELECT 1
  
  # Show or not log for each sql query
  spring.jpa.show-sql = true
  
  # Hibernate ddl auto (create, create-drop, update, validate)
  spring.jpa.hibernate.ddl-auto = validate
  
  #spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
  
  spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
  </code></pre>
  
  <p>Maybe it could be something related to the Hibernate Spatial configuration? (it seems me a litle strange because from what I know it is directly included into Hibernate 5 and it is no more an external project to add and configure).</p>
  
  <p>Finnally this is my <strong>pom.xml</strong> file containing all the used libraries:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;BeTriviusController&lt;/groupId&gt;
      &lt;artifactId&gt;BeTriviusController&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
      &lt;properties&gt;
          &lt;springboot.version&gt;1.4.1.RELEASE&lt;/springboot.version&gt;
      &lt;/properties&gt;
          &lt;parent&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
              &lt;version&gt;1.4.1.RELEASE&lt;/version&gt;
          &lt;/parent&gt;
  
          &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;!--dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
          &lt;/dependency--&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hsqldb&lt;/groupId&gt;
              &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-test&lt;/artifactId&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.assertj&lt;/groupId&gt;
                  &lt;artifactId&gt;assertj-core&lt;/artifactId&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;junit&lt;/groupId&gt;
                  &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
                  &lt;version&gt;RELEASE&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
                  &lt;artifactId&gt;hibernate-spatial&lt;/artifactId&gt;
                  &lt;version&gt;5.0.1.Final&lt;/version&gt;
                  &lt;!--&lt;version&gt;4.0&lt;/version&gt;--&gt;
              &lt;/dependency&gt;
  
          &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>So, what is wrong? What am I missing? How can I fix this issue and correctly map the Point location of my entity class with the value on the geographical_position table field having point as data type?</p>