Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Geo Spatial Queries with JPA

 
Ryan Kumsher
Greenhorn
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:

javax.persistence.criteria.CriteriaBuilder

function

<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.

Parameters:
name - function name
type - expected result type
args - function arguments
Returns:
expression




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))')

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic