-->
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.  [ 1 post ] 
Author Message
 Post subject: Legacy Database Mapping problem
PostPosted: Wed Jan 28, 2009 10:51 am 
Newbie

Joined: Mon Jul 18, 2005 7:45 pm
Posts: 15
Location: Argentina
Hi,

I'm dealing with a legacy database where I have all business primary keys (complex keys), no foreign keys.
And for worst, there are no null columns defined, instead, when a column
is optional, if it is not informed it will be zero or space depending on the sql type.
So if I use standard hibernate mapping and define an optional many-to-one relationship, when I try to get some property for the related class, I received a: org.hibernate.ObjectNotFoundException: No row with the given identifier exists

I'm asking if there is any way to avoid this.
thank you in advance
Daniel

Hibernate version:
3.2.6
Full stack trace of any exception that occurs:
11:49:17,978 ERROR [/adk]:678 - Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract com.extjs.gxt.ui.client.data.PagingLoadResult com.arballon.gwt.core.client.SalesCategoriesService.getSalesStatisticsDetailFigures(com.arballon.gwt.core.client.model.CategoryDTO,java.util.List,com.extjs.gxt.ui.client.data.BasePagingLoadConfig)' threw an unexpected exception: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.arballon.gwt.core.server.persistent.types.Zone#com.arballon.gwt.core.server.persistent.types.Type$$EnhancerByCGLIB$$5f97e0e0@23454016]
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:164)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.arballon.gwt.core.server.persistent.types.Zone#com.arballon.gwt.core.server.persistent.types.Type$$EnhancerByCGLIB$$5f97e0e0@23454016]
at org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound(SessionFactoryImpl.java:377)
at org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(AbstractLazyInitializer.java:79)
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:68)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:150)
at com.arballon.gwt.core.server.persistent.types.Zone$$EnhancerByCGLIB$$c360b244.getDescription(<generated>)
at com.arballon.gwt.core.server.dao.sales.SalesStatisticsDAO.getStatisticsDetailFigures(SalesStatisticsDAO.java:131)
at com.arballon.gwt.core.server.SalesCategoriesServiceImpl.getSalesStatisticsDetailFigures(SalesCategoriesServiceImpl.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
... 18 more

Name and version of the database you are using:
MS SQL Server 2005


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

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.