title: hibernate-spatial: sql query to retrieve a geometry
body: <p>I'm using postgresql, hibernate-spatial and postgis and expected to be able to use a SqlQuery to retrieve a Geometry object.</p>
  
  <p>However whenever I try to query a Point, Polygon or Geometry eg</p>
  
  <pre><code>List list = session.createSQLQuery(
      "select geomfromewkt('SRID=1;POINT(1 1)')").list();
  </code></pre>
  
  <p>I get the exception:</p>
  
  <pre><code>Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111
      at org.hibernate.dialect.TypeNames.get(TypeNames.java:78)
      at org.hibernate.dialect.TypeNames.get(TypeNames.java:103)
      at org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:328)
      at org.hibernate.loader.custom.CustomLoader$Metadata.getHibernateType(CustomLoader.java:590)
      at org.hibernate.loader.custom.CustomLoader$ScalarResultColumnProcessor.performDiscovery(CustomLoader.java:516)
      at org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.java:532)
      at org.hibernate.loader.Loader.getResultSet(Loader.java:1962)
      at org.hibernate.loader.Loader.doQuery(Loader.java:802)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
      at org.hibernate.loader.Loader.doList(Loader.java:2533)
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
      at org.hibernate.loader.Loader.list(Loader.java:2271)
      at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:316)
      at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1842)
      at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
      at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:157)
  </code></pre>
  
  <p>hibernate.cfg.xml:</p>
  
  <pre><code>&lt;property name="dialect"&gt;org.hibernatespatial.postgis.PostgisDialect&lt;/property&gt;
  </code></pre>
  
  <p>Is this not part of the hibernate-spatial offering or am i doing something wrong?</p>
  
  <p>Thanks, Paul.</p>
  
  <p>Relevant libraries/versions:</p>
  
  <ul>
  <li>hibernate-core-3.6.0.Final.jar</li>
  <li>postgresql-9.0-801.jdbc4.jar</li>
  <li>hibernate-spatial-postgis-1.1.1.jar</li>
  <li>hibernate-spatial-1.1.1.jar</li>
  <li>postgis-jdbc-1.3.3.jar</li>
  <li>jts-1.12.jar</li>
  </ul>