index. It is not used in the MySQL HS provider. I didn't realise it
>
> Hi all,
>
> I just started to use hubernatespatial few days ago and I am unable
> to make
> it work with a simple within query.
>
> I am usign java topology suite (to create class with geometry
> features) and
> all is made in spring. I guess that there should no be differences
> from
> non-spring contained environment.
>
> I will explain the problem i am facing: This function should
> return a list
> of estates that are contained inside a specific polygon.
>
> WKTReader fromText = new WKTReader();
> String myArea = "POLYGON ((11 42, 13 42, 13 44, 13 42, 11 42))";
> Geometry filter = null;
> try {
> filter = fromText.read(myArea);
> } catch (ParseException e) {
> throw new RuntimeException("Not a WKT String:" + myArea);
> }
> DetachedCriteria criteria = DetachedCriteria
> .forClass(Estate.class)
> .add(SpatialRestrictions.within("location", filter,filter));
> return (List<Estate>) hibernateTemplate.findByCriteria(criteria);
>
> The table estates has a column defined as Geometry.
>
> the SQL command: select id,astext(location) from estates , reports:
> ID - location
> 1 , POINT(11.538 42.872)
> 2 , POINT(10.917 42.883)
> 4 , POINT(11.083 42.883)
> 5 , POINT(10.917 42.883)
>
> Which is correct. Btw when I try to execute the above Java code i
> got the
> following error
>
> DEBUG SQL:401 - select this_.id as id0_0_, this_.location as
> location0_0_
> from estates this_ where within(this_.location,?)
> WARN JDBCExceptionReporter:77 - SQL Error: 0, SQLState: S1009
> ERROR JDBCExceptionReporter:78 - Parameter index out of bounds. 2
> is not
> between valid values of 1 and 1
>
> Ok so now the big question, does anyone know what is happening ?
>
> regards,
> Davide
> --
> View this message in context:
http://www.nabble.com/
> HibernateSpatial-MySql-within-query-tp15204531p15204531.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