<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Norman,<br>
<br>
thanks for the reply again! I've tried adding everything like you have
suggested... the <tt>org.postgis.GeomteryType</tt> needed appears to
be needed in the beans.jar inside the ear... However I have also packed
this in its own jar (hibernate-geomtype.jar) which I have placed in
both the <tt>$JBOSS$/client</tt> and <tt>$JBOSS$/server/default/lib</tt>
directories. FYI: the database schema is most definately not the
problem.<br>
<br>
I have tried everything I know to get this working, without success...
I can persist null geometry objects, and using native queries I seem to
persist the Geometry as garbage in the database... strange (Even tho I
am sending geomAsText(....) in my native insert statement).. <br>
<br>
It seems pretty obvious that my persistance container does not
understand what a Geomtery or GeometryType are.Below is a copy of the
stacktrace I get when I try and persist() a record containing a valid
POINT.  <br>
<br>
Attatched are my beans (which might make more scence that me!). <br>
<br>
<br>
Thanks in advance, and for the help you've already offered.<br>
<br>
<br>
Stacktrace from a manager.persist():<br>
<hr size="2" width="100%"><br>
<br>
<tt>09:52:24,200 INFO  [STDOUT] Hibernate: insert into Location (name,
geom, id) values (?, ?, ?)<br>
09:52:24,270 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null<br>
09:52:24,270 ERROR [JDBCExceptionReporter] Batch entry 0 insert into
Location (name, geom, id) values ( was aborted. Call getNextException()
to see th<br>
e cause.<br>
09:52:24,270 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: XX000<br>
09:52:24,270 ERROR [JDBCExceptionReporter] ERROR: parse error - invalid
geometry<br>
<br>
09:52:24,270 ERROR [AbstractFlushingEventListener] Could not
synchronize database state with session<br>
org.hibernate.exception.GenericJDBCException: Could not execute JDBC
batch update<br>
        at
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)<br>
        at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)<br>
        at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)<br>
        at
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)<br>
        at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)<br>
        at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)<br>
        at
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)<br>
        at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)<br>
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)<br>
        at
org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:296)<br>
        at
org.jboss.ejb3.entity.TransactionScopedEntityManager.flush(TransactionScopedEntityManager.java:204)<br>
        at
com.lisasoft.routedirections.ard.beans.RouteDirectionsARDBean.setLocation(RouteDirectionsARDBean.java:65)<br>
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
        at java.lang.reflect.Method.invoke(Method.java:585)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)<br>
        at
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)<br>
        at
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)<br>
        at
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)<br>
        at
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:131)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:263)<br>
        at
org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:58)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)<br>
        at $Proxy89.setLocation(Unknown Source)<br>
        at
com.lisasoft.routedirections.ard.delegates.LocationDelegate.setLocation(LocationDelegate.java:23)<br>
        at org.apache.jsp.index_jsp._jspService(index_jsp.java:92)<br>
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)<br>
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)<br>
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)<br>
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)<br>
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)<br>
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)<br>
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)<br>
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br>
        at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)<br>
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)<br>
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br>
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)<br>
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)<br>
        at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)<br>
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)<br>
        at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)<br>
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)<br>
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)<br>
        at
org.jboss.web.tomcat.tc5.sso.ClusteredSingleSignOn.invoke(ClusteredSingleSignOn.java:637)<br>
        at
org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)<br>
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)<br>
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)<br>
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)<br>
        at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)<br>
        at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)<br>
        at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)<br>
        at java.lang.Thread.run(Thread.java:595)<br>
Caused by: Batch entry 0 insert into Location (name, geom, id) values (
was aborted. Call getNextException() to see the cause.<br>
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:107)<br>
        at
org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:519)<br>
        at
org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)<br>
        at
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)<br>
        ... 68 more<br>
09:52:24,300 ERROR [RouteDirectionsARDBean] Problem with Hibernate SQL:<br>
javax.persistence.PersistenceException:
org.hibernate.exception.GenericJDBCException: Could not execute JDBC
batch update<br>
        at
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:641)<br>
        at
org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:299)<br>
        at
org.jboss.ejb3.entity.TransactionScopedEntityManager.flush(TransactionScopedEntityManager.java:204)<br>
        at
com.lisasoft.routedirections.ard.beans.RouteDirectionsARDBean.setLocation(RouteDirectionsARDBean.java:65)<br>
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
        at java.lang.reflect.Method.invoke(Method.java:585)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)<br>
        at
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)<br>
        at
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)<br>
        at
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)<br>
        at
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:131)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:263)<br>
        at
org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:58)<br>
        at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)<br>
        at
org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)<br>
        at $Proxy89.setLocation(Unknown Source)<br>
        at
com.lisasoft.routedirections.ard.delegates.LocationDelegate.setLocation(LocationDelegate.java:23)<br>
        at org.apache.jsp.index_jsp._jspService(index_jsp.java:92)<br>
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)<br>
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)<br>
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)<br>
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)<br>
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)<br>
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)<br>
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)<br>
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br>
        at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)<br>
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)<br>
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br>
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)<br>
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)<br>
        at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)<br>
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)<br>
        at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)<br>
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)<br>
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)<br>
        at
org.jboss.web.tomcat.tc5.sso.ClusteredSingleSignOn.invoke(ClusteredSingleSignOn.java:637)<br>
        at
org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)<br>
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)<br>
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)<br>
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)<br>
        at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)<br>
        at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)<br>
        at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)<br>
        at java.lang.Thread.run(Thread.java:595)<br>
Caused by: org.hibernate.exception.GenericJDBCException: Could not
execute JDBC batch update<br>
        at
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)<br>
        at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)<br>
        at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)<br>
        at
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)<br>
        at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)<br>
        at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)<br>
        at
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)<br>
        at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)<br>
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)<br>
        at
org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:296)<br>
        ... 62 more<br>
Caused by: Batch entry 0 insert into Location (name, geom, id) values (
was aborted. Call getNextException() to see the cause.<br>
        at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:107)<br>
        at
org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:519)<br>
        at
org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)<br>
        at
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)<br>
        ... 68 more</tt><br>
<br>
<br>
<br>
<br>
<br>
<br>
Norman Barker wrote:
<blockquote
 cite="midB67A5FB7A8114B47A70517C9C0D102E8131D02@bath.uk.rsinc.com"
 type="cite">
  <pre wrap="">Hi Andrew,

What you are saying is correct, but I will expand on it just to be clear
for you and others.

You have to add the GeometryType to your project, and postgis.jar, and
postgresqlXx.jar to the JBoss path (JBOSS_HOME\server\default\lib for
example).

It is then sufficient to mark a geometry getter of a POJO (with the
@Entity annotation at the class level) as       

@Type(type = "org.postgis.hibernate.GeometryType")
@Column(name="bbox", columnDefinition="Geometry")   (name can be
whatever you want, or you can leave it to hibernate to choose it for you
:-) )

Then in your stateless session bean you can inject the entityManager 

        @PersistenceContext(unitName="MyConfiguration")
        private EntityManager entityManager;

and persist your entity pojos as per normal.

If you configure your persistence.xml as follows then the PostGIS tables
of your spatial database are created for you (can be a good or a bad
thing depending on your view point, you have to add the spatial index by
hand).

<persistence>
        <persistence-unit name="MyConfiguration">
                <jta-data-source>java:/MY_DS</jta-data-source>
                <properties>
                        <property name="hibernate.dialect"
value="org.hibernate.dialect.PostgreSQLDialect"/>
                        <property name="hibernate.hbm2ddl.auto"
value="update"/>
                        <!-- property name="hibernate.show_sql"
value="true"/>  -->
                </properties>
        </persistence-unit>
</persistence>

Hope this gets you started, please post your findings back to the list.

Thanks,

Norman

-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a>
[<a class="moz-txt-link-freetext" href="mailto:postgis-users-bounces@postgis.refractions.net">mailto:postgis-users-bounces@postgis.refractions.net</a>] On Behalf Of
Andrew Hughes
Sent: 19 December 2006 02:05
To: PostGIS Users Discussion
Subject: Re: [postgis-users] SpatialEJB3: (PostGIS and Hibernate)

Hi Norman,

Thanks very much for the reply. Originally I noticed that this was an 
eclipse project, so I tried to get it to compile in Eclipse.... however 
this failed (and I made the wrong assumption that I needed the JBoss IDE

plugins installed).

Anyway, I have tried this with Ant directly and I now have this 
compiling.. and building the injest.jar.

I don't want to use the message driven beans as in the tutorial... or 
SOAP,  I am using stateless session beans, currently with PostgreSQL... 
but I obviously want to add the Geometry Type to the hibernate actions.

I am correct in assuming that I simply need to add the GeometryType.java

class to my project to enable this? I would then use annotations to 
specify the GeometryType such as:

@Type(type = "org.postgis.hibernate.GeometryType")

Is there anything that I am missing?

Thanks in advance

--AH



Norman Barker wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi Andrew,

Hopefully this gets to you before you start downloading the JBoss IDE!

The project uses Ant, and the Java 1.5 JDK.

(<a class="moz-txt-link-freetext" href="http://ant.apache.org">http://ant.apache.org</a>)
(<a class="moz-txt-link-freetext" href="http://svn.refractions.net/postgis/trunk/java/ejb3/build.xml">http://svn.refractions.net/postgis/trunk/java/ejb3/build.xml</a>)

If you edit the paths in build.xml to point to your installation,
running 'ant deploy' will build and deploy everything to JBoss for
    </pre>
  </blockquote>
  <pre wrap=""><!---->you.
  </pre>
  <blockquote type="cite">
    <pre wrap="">I used to use the JBoss IDE in the XDoclet for EJB2.x days, but with
annotations I have dumped it for plain eclipse - but perhaps I should
give it a go.

Norman

  

-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a>
[<a class="moz-txt-link-freetext" href="mailto:postgis-users-bounces@postgis.refractions.net">mailto:postgis-users-bounces@postgis.refractions.net</a>] On Behalf Of
Andrew Hughes
Sent: 18 December 2006 05:48
To: PostGIS Users Discussion
Subject: Re: [postgis-users] SpatialEJB3: (PostGIS and Hibernate)

Thanks for the reply....

I have checked out the EJB3Spatial source from SVN: 
<a class="moz-txt-link-freetext" href="http://svn.refractions.net/postgis/trunk/java/ejb3/">http://svn.refractions.net/postgis/trunk/java/ejb3/</a>

Now, I am presuming that this requires the JBoss IDE? since it doesn't
    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
  <blockquote type="cite">
    <pre wrap="">build with Eclipse.... and I can't see this anywhere in the tutorial.

The JBoss plugins are in total 119Mb.... which is rather painful and 
slow... it would be rather helpful if the binaries where available for
    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
  <blockquote type="cite">
    <pre wrap="">direct download.


When I finally get this downloaded I'll hopefully make some good
progress :)




Norman Barker wrote:
  
    </pre>
    <blockquote type="cite">
      <pre wrap="">Hi,

Glad you like the idea! PostGIS does all the work though J, and there
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">have been some good bug reports and questions from users as well.

In conclusion;

There have been quite a few users of the EJB3 Geometry annotations, 
but they are split between JBoss users, and pure Hibernate/Spring 
users - it works well in either environment. Since it is possible to 
mark a property of an entity as @Geometry and then have it persist
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->and
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">    
      </pre>
    </blockquote>
    <pre wrap="">  
    </pre>
    <blockquote type="cite">
      <pre wrap="">retrieve from PostGIS then the investigation was a success, and I am 
using it in more projects (and once my current deadlines are out of 
the way, I want to do some more to the codebase).

The incorporation of spatial functions into hql and ejb-ql is I 
believe the next step, but quite a major undertaking. Certainly at
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->the
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">    
      </pre>
    </blockquote>
    <pre wrap="">  
    </pre>
    <blockquote type="cite">
      <pre wrap="">moment you could achieve the same functionality with 
entitymanager.createNativeQuery for example (which I use to run
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->vacuum
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">    
      </pre>
    </blockquote>
    <pre wrap="">  
    </pre>
    <blockquote type="cite">
      <pre wrap="">analyze).

Let me know if you have any questions, and do post more details about
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">your project, there have been some interesting use cases.

Thanks,

Norman


    
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->------------------------------------------------------------------------
  </pre>
  <blockquote type="cite">
    <pre wrap="">  
    </pre>
    <blockquote type="cite">
      <pre wrap="">*From:* <a class="moz-txt-link-abbreviated" href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a> 
[<a class="moz-txt-link-freetext" href="mailto:postgis-users-bounces@postgis.refractions.net">mailto:postgis-users-bounces@postgis.refractions.net</a>] *On Behalf Of 
*Andrew Hughes
*Sent:* 12 December 2006 04:39
*To:* PostGIS Users Discussion
*Subject:* [postgis-users] SpatialEJB3: (PostGIS and Hibernate)

Hello All,

I would like to use the SpatialEJB3 JBoss container for my JBoss Web 
Service.

The SpatialEJB3 [ 
<a class="moz-txt-link-freetext" href="http://postgis.refractions.net/support/wiki/index.php?SpatialEJB3">http://postgis.refractions.net/support/wiki/index.php?SpatialEJB3</a> ] 
seems to be exactly what I want, but I do have some concerns before I
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">invest some time in this.....

    * Was there a conclusion to the SpatialEJB3 Investigation:
      "/Spatial EJB3 is a quick investigation to see if it is
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->possible
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">      to integrate the Java 5 annotation approach to mark a property
      of an object as spatial and to delegate to the EJB3 persistence
      model to store and retrieve this data./"?
    * I require the PostGIS functions [such as
      /intersects(geometry,geometry)/] to extract the data I am
      looking for in my spatial database. I am unable to find a
      reference to any java code that shows someone running anything
      [like /select intersection(my_geom,geometry) from
      locations_table where intersects(my_geom,geomtery);/ ] ?


For the people who are involved in the Spatial EJB3, I really like
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->the
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">    
      </pre>
    </blockquote>
    <pre wrap="">  
    </pre>
    <blockquote type="cite">
      <pre wrap="">idea... well-done!!!


--AH


    
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->------------------------------------------------------------------------
  </pre>
  <blockquote type="cite">
    <pre wrap="">  
    </pre>
    <blockquote type="cite">
      <pre wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<a class="moz-txt-link-freetext" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
  
    
      </pre>
    </blockquote>
    <pre wrap="">
  
    </pre>
  </blockquote>
  <pre wrap=""><!---->

  </pre>
</blockquote>
<br>
</body>
</html>