-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Custom functions in a dialect
PostPosted: Mon Jan 08, 2007 8:22 am 
Newbie

Joined: Mon Jan 08, 2007 8:17 am
Posts: 4
Hi,

I wrote a custom user type for PostGIS the spatial database here

http://postgis.refractions.net/support/ ... patialEJB3

and am now looking to add custom function to support spatial functions in a PostGIS dialect, but I am getting errors

Caused by: java.lang.IllegalStateException: No data type for node: org.hibernate
.hql.ast.tree.MethodNode

when I try to execute the following

Query test = entityManager.createQuery("Select AsText(p.location) from PersonEntity p");

where location is custom user type Geometry marked, and persists fine to the db.

My dialect looks like this (very simple at the moment), do you have any suggestions.

public class PostGISDialect extends PostgreSQLDialect{
public PostGISDialect()
{
super();
registerFunction("AsText", new StandardSQLFunction("AsText", Hibernate.custom(GeometryType.class)));
}
}

Many thanks,

Norman


Top
 Profile  
 
 Post subject: PostGIS dialect - complete
PostPosted: Thu Feb 01, 2007 5:06 am 
Newbie

Joined: Mon Jan 08, 2007 8:17 am
Posts: 4
Hi,

there have been a lot of posts on PostGIS (including one by me!)

I wrote some code for this, dialect, and geometry custom type are described here (as part of the PostGIS project)

http://article.gmane.org/gmane.comp.gis ... ct+queries


thanks,

Norman


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.