title: Get Query is not working when using HQL in Hibernate Spatial
body: <p>I am using Spring boot along with Hibernate for a Spatial query.
  Libraries used:
  1. Spring boot - 2.1.3.RELEASE
  2. Hibernate Spatial - 5.3.7.Final
  3. MariaDB - mysql  Ver 15.1 Distrib 10.1.36-MariaDB</p>
  
  <p>Whenever I use HQL as depicted below in Query, I am getting the following error during application startup however when I try using native query it works.</p>
  
  <p>I have tried with different dialects. Also, tried using columnDefinition with value as geometry, geolatte-geometry.</p>
  
  <p>pom.xml</p>
  
  <pre><code>&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.hibernate&lt;/groupId&gt;
        &lt;artifactId&gt;hibernate-spatial&lt;/artifactId&gt;
        &lt;exclusions&gt;
          &lt;exclusion&gt;
            &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
            &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
          &lt;/exclusion&gt;
        &lt;/exclusions&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;
  </code></pre>
  
  <p>application.yml</p>
  
  <pre><code>spring:
    datasource:
      driver-class-name: com.mysql.cj.jdbc.Driver
    jpa:
      hibernate:
        ddl-auto: none
      properties:
        hibernate:
          jdbc:
            lob:
              non_contextual_creation: true
          physical_naming_strategy: com.orange.alc.polygon.dao.config.DefaultNamingStrategy 
          format_sql: false
          dialect: org.hibernate.spatial.dialect.mysql.MySQLSpatialDialect 
  
  @Entity
  public class PolygonMasterEntity {
  
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
  
    // Here we have used Geolatte library
    private Polygon geometry;
  
    @Column(name = "is_active")
    private Boolean active;
  
    @Column(name = "is_deleted")
    private Boolean deleted;
  }
  
  @Repository
  public interface PolygonMasterRepository extends JpaRepository&lt;PolygonMasterEntity, Long&gt;,
      JpaSpecificationExecutor&lt;PolygonMasterEntity&gt; {
  
    @Query("select master from #{#entityName} master WHERE" 
        + " and within(master.geometry, :point)")
    List&lt;PolygonMasterEntity&gt; findCostUsingPointForLLME(
        @Param("point") Point point);
  
  }
  </code></pre>
  
  <p>Currently, I am getting the following error during startup:</p>
  
  <p>Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: ( near line 1, column 164 [select master from com.orange.alc.polygon.dao.entity.PolygonMasterEntity master WHERE within(master.geometry, :point)]</p>
  
  <pre><code>~~~~~~~~~   at org.hibernate.hql.internal.ast.ErrorTracker.throwQueryException(ErrorTracker.java:93)
  ~~~~~~~~~   at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:277)
  ~~~~~~~~~   at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:191)
  ~~~~~~~~~   at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:143)
  ~~~~~~~~~   at org.hibernate.engine.query.spi.HQLQueryPlan.&lt;init&gt;(HQLQueryPlan.java:119)
  ~~~~~~~~~   at org.hibernate.engine.query.spi.HQLQueryPlan.&lt;init&gt;(HQLQueryPlan.java:80)
  ~~~~~~~~~   at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:153)
  ~~~~~~~~~   at org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:595)
  ~~~~~~~~~   at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:704)
  ~~~~~~~~~   ... 100 common frames omitted
  
  
  </code></pre>