Ryan Kumsher

Greenhorn
+ Follow
since Aug 16, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ryan Kumsher

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
Blaise,

Thanks a lot for the in depth posts. This was real helpful for me in learning some of the basics of JPA and JAXB. I'm looking forward to implementing this technique and getting rid of my ugly helper class I wrote to convert between the 2.
I am creating REST services to insert users into a database using JERSEY, JAXB, and JPA. I am new to all 3 technologies...

Currently I am accepting a JAXB user object.
Converting to a JPA user object using a helper class I wrote
Then persisting the JPA user



Is there an easy way (automatic code generation hopefully) to combine the JAXB and JPA classes so I don't have to convert the JAXB user class into a JPA user class? This way I could just call em.persist(user) on the object passed in to the addUser method. It looks like EclipseLink Moxy might be of use here but couldn't find a good example...

Thanks