specification on which Hibernate Spatial is based. For Oracle,
OracleSpatialRestrictions factory class. So if you're using Oracle,
you're in luck. For postgis, these types of operators still need to
>
> Hello again!
>
> It seems like your solution works as you've described. I was able
> to choose
> dialect by changing it in the hibernate.cfg.xml, but this isn't the
> end of
> my problems. The project I'm working on is a Spring project, and all
> configuration is put in the applicationContext.xml file - including
> the
> Hibernate configuration. The properties bean looks something like:
>
> <bean id="hibernateProperties"
>
> class="org.springframework.beans.factory.config.PropertiesFactoryBean"
> >
> <property name="properties">
> <props>
> <prop key="hibernate.default-lazy">false</prop>
> <prop key="hibernate.show_sql">true</prop>
> <prop key="hibernate.hbm2ddl.auto">update</prop>
> <prop
> key="hibernate.dialect">org.hibernatespatial.postgis.PostgisDialect</p
> rop>
> <prop key="hibernate.cache.use_second_level_cache">false</prop>
> <prop key="hibernate.cache.use_query_cache">false</prop>
> </props>
> </property>
> </bean>
>
> The code snipplet you submitted will have to be run somewhere (and
> before
> Hibernate gets initialized by Spring), but I've had a hard time
> trying to
> figure out where to put it, and how I can make Spring execute it
> before
> Hibernate is initialized.
>
> I also have another question:
> I've implemented the within()-search using Criterion. But is there an
> "nearest neighbour"-search?
>
>
> Regards,
>
> Håvard N
>
>
> Karel Maesen wrote:
>>
>> Hi,
>>
>> First, you're correct in that the HBSpatialExtension doesn't
>> automatically use the configuration file to determine the spatial
>> dialect. Secondly, the configuration system isn't completely
>> finished, and some issues are not settled.
>>
>> It is possible, however, to ensure that the correct spatial dialect
>> is determined from the hibernate.dialect property. In start-up code
>> (HibernateUtil, or some such) you should add the following code:
>>
>> // configure Hibernate
>> Configuration hbConfig = new Configuration();
>> hbConfig.configure();
>>
>> //configure Hibernate Spatial
>> HSConfiguration hsConfig = new HSConfiguration();
>> //inspect the hibernate.dialect from the Hibernate Configuration.
>> hsConfig.configure(hbConfig);
>> //... and set HBSpatialExtension to this configuration
>> HBSpatialExtension.setConfiguration(hsConfig);
>>
>> Let me know if this works.
>>
>> Regards,
>>
>> Karel Maesen
>> _______________________________________________
>> hibernatespatial-users mailing list
>>
[hidden email]
>>
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/
>> hibernatespatial-users
>>
>>
>
> --
> View this message in context:
http://www.nabble.com/Choosing-
> Dialect-with-hibernate.cfg.xml---tp17335222p17664393.html
> Sent from the Hibernate Spatial - Users mailing list archive at
> Nabble.com.
>
> _______________________________________________
> hibernatespatial-users mailing list
>
[hidden email]
>
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/
> hibernatespatial-users