java - MyBatis + PostgreSQL/PostGIS -


i'm attempting perform radial search of database rows in postgresql database using mybatis object mapper return java objects. connection , queries work expected, except radial search. i've installed postgis in db. queries set in xml configuration files. troublesome query is...

select * "events"     (st_dwithin("creationlocation"::geography, st_setsrid(st_point(#{longitude}, #{latitude}), 4326)::geography, #{radius})     , "tag" = 0 , "eventtime" >= now()) 

if connect directly database using pgadmin , run query same parameters passed in mapper, multiple (correct) results. when mapper runs query, no results. believe has prepared statements of mybatis don't know more that.

well figured issue out changing st_setsrid(...) to

st_geogfromtext('srid=4326;point(' || #{longitude} || ' ' || #{latitude} || ')') 

my assumption (though haven't confirmed) object mapper didn't know how handle double-nested parameters, , getting passed '?' instead of real value lat , long.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -