Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Geo Spatial Queries with JPA

Ryan Kumsher
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using the Criteria api, how can I go about using SQL Server 2008 GeoSpatial functions in my queries?

CriteriaBuilder.function() looks promising:



<T> Expression<T> function(java.lang.String name,
java.lang.Class<T> type,
Expression<?>... args)

Create an expression for the execution of a database function.

name - function name
type - expected result type
args - function arguments

It looks like I can use CriteriaBuilder.function() for static geometry functions, but how would I go about calling a geometry instance function of SQL Server?
Example: shape.STIntersects('POLYGON((1 2,3 4,5 6,1 2))')

What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!