-->
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.  [ 3 posts ] 
Author Message
 Post subject: Error update
PostPosted: Wed Apr 01, 2009 5:47 pm 
Newbie

Joined: Fri Oct 31, 2008 11:35 am
Posts: 12
Hi i have a problem, I can add object to my collection called "guia", but I can't detach elements, it allways try to update even when i don´t have elements in my collection and I don´t know why!!

Please help me, I got 2 day trying to find out what it´s happend.

My program throws this exception:

Code:
- SQL Error: 515, SQLState: HY000
- [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert the value NULL into column 'ID_PEDIMENTO', table 'ALGOSAFis.dbo.GUIA'; column does not allow nulls. UPDATE fails.
- SQL Error: 3621, SQLState: HY000
- [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The statement has been terminated.
- Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not delete collection: [Comercio.Pedimento.Pedimento.guia#81633878003229]
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1071)
        at org.hibernate.action.CollectionRemoveAction.execute(CollectionRemoveAction.java:28)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:143)
        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
        at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
        at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
        at ALGOSA.Seguridad.Manager.Bean.BeanFiltroP.confirmaOperacion(BeanFiltroP.java:624)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
        at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
        at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:88)
        at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
        at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:746)
        at javax.faces.component.UICommand.broadcast(UICommand.java:368)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
        at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
        at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCyclePartial(ReceiveSendUpdates.java:64)
        at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:40)
        at com.icesoft.faces.webapp.http.core.ViewBoundServer.service(ViewBoundServer.java:65)
        at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:44)
        at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
        at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
        at com.icesoft.faces.webapp.http.servlet.GlassFishAdaptingServlet.service(GlassFishAdaptingServlet.java:60)
        at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
        at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:139)
        at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
        at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:82)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:46)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert the value NULL into column 'ID_PEDIMENTO', table 'ALGOSAFis.dbo.GUIA'; column does not allow nulls. UPDATE fails.
        at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
        at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
        at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
        at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
        at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
        at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
        at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
        at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
        at com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
        at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
        at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1048)
        ... 68 more
CLASE DE EXCEPCION: class org.hibernate.exception.GenericJDBCException
could not delete collection: [Comercio.Pedimento.Pedimento.guia#81633878003229]
org.hibernate.exception.GenericJDBCException: could not delete collection: [Comercio.Pedimento.Pedimento.guia#81633878003229]
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1071)
        at org.hibernate.action.CollectionRemoveAction.execute(CollectionRemoveAction.java:28)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:143)
        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
        at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
        at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
        at ALGOSA.Seguridad.Manager.Bean.BeanFiltroP.confirmaOperacion(BeanFiltroP.java:624)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
        at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
        at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:88)
        at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
        at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:746)
        at javax.faces.component.UICommand.broadcast(UICommand.java:368)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
        at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
        at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCyclePartial(ReceiveSendUpdates.java:64)
        at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:40)
        at com.icesoft.faces.webapp.http.core.ViewBoundServer.service(ViewBoundServer.java:65)
        at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:44)
        at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
        at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
        at com.icesoft.faces.webapp.http.servlet.GlassFishAdaptingServlet.service(GlassFishAdaptingServlet.java:60)
        at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
        at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:139)
        at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
        at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:82)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:46)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert the value NULL into column 'ID_PEDIMENTO', table 'ALGOSAFis.dbo.GUIA'; column does not allow nulls. UPDATE fails.
        at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
        at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
        at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
        at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
        at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
        at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
        at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
        at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
        at com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
        at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
        at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1048)
        ... 68 more
class org.hibernate.exception.GenericJDBCExceptioncould not delete collection: [Comercio.Pedimento.Pedimento.guia#81633878003229]
org.hibernate.exception.GenericJDBCException: could not delete collection: [Comercio.Pedimento.Pedimento.guia#81633878003229]
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1071)
        at org.hibernate.action.CollectionRemoveAction.execute(CollectionRemoveAction.java:28)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:143)
        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
        at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
        at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
        at ALGOSA.Seguridad.Manager.Bean.BeanFiltroP.confirmaOperacion(BeanFiltroP.java:624)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
        at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
        at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:88)
        at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
        at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:746)
        at javax.faces.component.UICommand.broadcast(UICommand.java:368)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
        at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
        at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCyclePartial(ReceiveSendUpdates.java:64)
        at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:40)
        at com.icesoft.faces.webapp.http.core.ViewBoundServer.service(ViewBoundServer.java:65)
        at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:44)
        at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
        at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
        at com.icesoft.faces.webapp.http.servlet.GlassFishAdaptingServlet.service(GlassFishAdaptingServlet.java:60)
        at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
        at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:139)
        at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
        at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:82)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:46)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert the value NULL into column 'ID_PEDIMENTO', table 'ALGOSAFis.dbo.GUIA'; column does not allow nulls. UPDATE fails.
        at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
        at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
        at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
        at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
        at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
        at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
        at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
        at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
        at com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
        at com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
        at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
        at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1048)
        ... 68 more
ROLLBACK EJECUTADO


theese are my files:

Code:

********PEDIMENTO

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
  <class dynamic-insert="false" dynamic-update="false" mutable="true"
         name="Comercio.Pedimento.Pedimento" optimistic-lock="version"
         polymorphism="implicit" select-before-update="false" table="PEDIMENTO">
    <id column="ID_PEDIMENTO" name="idPedimento" unsaved-value="0">
      <generator class="assigned"/>
    </id>
    <set  cascade="delete-all-orphans" inverse="false" lazy="false" name="guia" table="GUIA" >
      <key column="ID_PEDIMENTO"/>
      <one-to-many class="Comercio.Catalogo.Guia"/>
    </set>
  </class>
</hibernate-mapping>

**********GUIA

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
  <class dynamic-insert="false" dynamic-update="false" mutable="true"
         name="Comercio.Catalogo.Guia" optimistic-lock="version"
         polymorphism="implicit" select-before-update="false" table="GUIA">
    <composite-id>
      <key-property column="GUIA" name="guia"/>
      <key-property column="ID_PEDIMENTO" name="idPedimento"/>
    </composite-id>
  </class>
</hibernate-mapping>





and this is my method wich one I save or update my collection.




Code:
public void confirmaOperacion(ActionEvent event){
        this.captura = false;
        Session sessionL = null;
        //Limpia valores nuevos
        this.setNewGuia(null);
         this.setCurrentGuia(null);

        if(getCurrentPedimento().getGuia().size() == 0)
            getCurrentPedimento().setGuia(new TreeSet());
        //Limpia valores actuales
        try{
            sessionL = HibernateUtil.getSessionFactory()
                                    .getCurrentSession();
            sessionL.beginTransaction();
            sessionL.flush();
            fil_idPedimento = getCurrentPedimento().getIdPedimento();

            sessionL.saveOrUpdate(getCurrentPedimento());
            sessionL.getTransaction().commit();
            System.out.println("TRANSACCION TERMINADA EN SAVERORUPDATE");
            //sessionL.flush();
        }
        catch(Exception ex){
            System.out.println(ex.getClass() + ex.getMessage());
                ex.printStackTrace();
                sessionL.getTransaction().rollback();
                System.out.println("ROLLBACK EJECUTADO");
        }
        }
        finally{
            try{
                String query = "from Pedimento";
                String where = "";
                String orderBy = "";
                if(this.fil_idPedimento > 0){
                    if(where.equals(""))
                        where = " where ";
                    else
                        where += " and";
                    where += " idPedimento=:idCC";
                }

                orderBy = " order by fechaCaptura";
                sessionL = HibernateUtil.getSessionFactory()
                                        .getCurrentSession();
                sessionL.beginTransaction();
                sessionL.flush();
                System.out.println("query:" + query + where + orderBy);

                Query q = sessionL.createQuery(query + where + orderBy);

                if(this.fil_idPedimento > 0)
                    q.setLong("idCC", this.fil_idPedimento);
                List sResult = q.list();

                setCurrentPedimento(null);
                setCurrentPedimento((Pedimento)sResult.get(0));
                sessionL.getTransaction().commit();
                System.out.println("CARGA REALIZADA");
                //sessionL.flush();
            }catch(Exception ex3){
                System.out.println("ERROR EN EX3");
                ex3.printStackTrace();
            }
            if(sessionL.isOpen())
                sessionL.close();
        }
    }

[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 02, 2009 2:30 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Since your "guia" <set> has inverse="false" you must allow null values in the GUIA.ID_PEDIMENTO column. This is explained in the following example in the Hibernate documentation: http://www.hibernate.org/hib_docs/v3/re ... bidir.html

But, I think you will run into problems here since the GUIA.ID_PEDIMENTO column is part of the primary key which probably means that the database will forbid you to allow nulls in this column. The solution to this is to make the association bidirectional. Eg. you need to have <set name="guia" inverse="true" ...> and a <many-to-one> from Guia to Pedimento. It is all explained in the example above. The only complicating thing may be the composite primary key in Guia but there is probably a solution for that as well.


Top
 Profile  
 
 Post subject: org.hibernate.TransientObjectException
PostPosted: Fri Apr 03, 2009 6:41 pm 
Newbie

Joined: Fri Oct 31, 2008 11:35 am
Posts: 12
ey men, thanks a lot, but now i have this other case with a different exception.

this is the exception

Code:
CLASE DE EXCEPCION: class org.hibernate.TransientObjectException
object references an unsaved transient instance - save the transient instance before flushing: Comercio.Pedimento.IdentificadorPedimento
org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: Comercio.Pedimento.IdentificadorPedimento
        at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
        at org.hibernate.type.EntityType.getIdentifier(EntityType.java:397)
        at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:242)
        at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:597)
        at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:3123)
        at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:479)
        at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:204)
        at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:127)
        at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
        at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
        at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
        at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
        at ALGOSA.Seguridad.Manager.Bean.BeanFiltroP.confirmaOperacion(BeanFiltroP.java:624)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
        at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
        at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:88)
        at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
        at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:746)
        at javax.faces.component.UICommand.broadcast(UICommand.java:368)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
        at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
        at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCyclePartial(ReceiveSendUpdates.java:64)
        at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:40)
        at com.icesoft.faces.webapp.http.core.ViewBoundServer.service(ViewBoundServer.java:65)
        at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:44)
        at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
        at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
        at com.icesoft.faces.webapp.http.servlet.GlassFishAdaptingServlet.service(GlassFishAdaptingServlet.java:60)
        at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
        at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:139)
        at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
        at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:82)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:46)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
class org.hibernate.TransientObjectExceptionobject references an unsaved transient instance - save the transient instance before flushing: Comercio.Pedimento.IdentificadorPedimento
org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: Comercio.Pedimento.IdentificadorPedimento
        at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
        at org.hibernate.type.EntityType.getIdentifier(EntityType.java:397)
        at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:242)
        at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:597)
        at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:3123)
        at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:479)
        at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:204)
        at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:127)
        at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
        at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
        at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
        at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
        at ALGOSA.Seguridad.Manager.Bean.BeanFiltroP.confirmaOperacion(BeanFiltroP.java:624)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
        at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
        at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:88)
        at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
        at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:746)
        at javax.faces.component.UICommand.broadcast(UICommand.java:368)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
        at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
        at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCyclePartial(ReceiveSendUpdates.java:64)
        at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:40)
        at com.icesoft.faces.webapp.http.core.ViewBoundServer.service(ViewBoundServer.java:65)
        at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:44)
        at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
        at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
        at com.icesoft.faces.webapp.http.servlet.GlassFishAdaptingServlet.service(GlassFishAdaptingServlet.java:60)
        at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
        at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:139)
        at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
        at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
        at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:82)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:46)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
ROLLBACK EJECUTADO




this are my map files


Code:

*****PEDIMENTO

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
  <class dynamic-insert="false" dynamic-update="false" mutable="true"
         name="Comercio.Pedimento.Pedimento" optimistic-lock="version"
         polymorphism="implicit" select-before-update="false" table="PEDIMENTO">
    <id column="ID_PEDIMENTO" name="idPedimento" unsaved-value="0">
      <generator class="assigned"/>
    </id>
    <set cascade="all-delete-orphan" inverse="false" lazy="false" name="identificador" table="IDENTIFICADOR_PEDIMENTO">
      <key column="ID_PEDIMENTO"/>
      <one-to-many class="Comercio.Pedimento.IdentificadorPedimento"/>
    </set>
  </class>
</hibernate-mapping>


****IDENTIFICADOR

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
  <class dynamic-insert="false" dynamic-update="false" mutable="true" name="Comercio.Pedimento.IdentificadorPedimento" optimistic-lock="version" polymorphism="implicit" select-before-update="false" table="IDENTIFICADOR_PEDIMENTO">
    <id column="ID_IDENTIFICADOR" name="idIdentificador">
      <generator class="increment"/>
    </id>

    <many-to-one column="ID_PEDIMENTO" name="pedimento" not-null="true"/>

    <many-to-one cascade="none" class="Comercio.Pedimento.Identificador" column="CLAVE_IDENTIFICADOR" insert="false" lazy="false" name="identificador" update="false"/>
    <set cascade="all-delete-orphan" inverse="true" lazy="false" name="complementoPedimento" table="COMPLEMENTO_PEDIMENTO">
      <key column="ID_IDENTIFICADOR"/>
      <one-to-many class="Comercio.Pedimento.ComplementoPedimento"/>
    </set>
  </class>
</hibernate-mapping>


********COMPLEMENTO}


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
  <class dynamic-insert="false" dynamic-update="false" mutable="true" name="Comercio.Pedimento.ComplementoPedimento" optimistic-lock="version" polymorphism="implicit" select-before-update="false" table="COMPLEMENTO_PEDIMENTO">
    <id column="ID_COMPLEMENTO" name="idComplemento">
        <generator class="increment"/>
    </id>
    <!--<many-to-one column="ID_IDENTIFICADOR" name="identificadorPedimento"/>-->
    <property column="ID_IDENTIFICADOR" name="idIdentificador"/>
    <property column="ID_PEDIMENTO" name="idPedimento"/>
    <property column="COMPLEMENTO" name="complemento"/>
    <property column="DESCRIPCION" name="descripcion"/>
  </class>
</hibernate-mapping>





And these are may POJOS.



Code:
********************PEDIMENTO

package Comercio.Pedimento;

import Comercio.Catalogo.AgenteAduanal;
import Comercio.Catalogo.Provedor;
import Comercio.Anexo22.Aduana;
import Comercio.Anexo22.ClavePedimento;
import Comercio.Anexo22.Destino;
import Comercio.Anexo22.Factura;
import Comercio.Anexo22.FormaPago;
import Comercio.Anexo22.MedioTransporte;
import Comercio.Anexo22.Moneda;
import Comercio.Anexo22.Regimen;
import Mantenimiento.General.Cliente;
import Mantenimiento.General.TipoActualizacion;
import java.io.Serializable;
import java.util.Date;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;
//Crystal R.
import java.sql.ResultSet;
import com.businessobjects.samples.pojo.POJOResultSetFactory;

public class Pedimento implements Serializable, Comparable{
    private long idPedimento;
    private long folioCC;
    private String tipoOperacion;
    private double tipoCambio;
    private double pesoBruto;
    private double valorAduana;
    private double valorDolares;
    private double valorFacturas; //valor dolares para el desglose
    private double valorComercial;
    private String acuseElectronico;
    private int tipoTasa;
    private double total;
    private double otros;
    private double efectivo;
    private double importe;
    private double fletes;
    private double primasSeguros;
    private double embalajes;
    private double incrementables;
    private double valorSeguros;
    private double bultos;
    private String marcas;
    private String numeros;
    private Date fechaCaptura;
   
   
    private Set partidaPedimento = new TreeSet();
    private Set observacion = new TreeSet();
    private Set contenedor = new TreeSet();
    private Set cuentaPedimento = new TreeSet();
    private Set diferencia = new TreeSet();
    private Set factura = new TreeSet();
    private Set fecha = new TreeSet();
    private Set guia = new TreeSet();
    private Set identificador = new TreeSet();
    private Set transporte = new TreeSet();
    private Set contribucion = new TreeSet();
    private Set tasa = new TreeSet();
    private Set descargo = new TreeSet();

   
    private ClavePedimento clavePedimento;
    private Regimen regimen;
    private Destino destino;
    private Aduana aduanaEntradaSalida = null;
    private Aduana aduanaDespacho = null;
    private MedioTransporte transporteEntradaSalida;
    private MedioTransporte transporteArribo;
    private MedioTransporte transporteSalida;
    private Cliente cliente;
    //private Contribucion contribucion;
    private FormaPago formaPago;
    private AgenteAduanal patente;
    private Provedor provedor;
    private Moneda moneda;
    private RectificacionPedimento rectificacion;
    private TipoActualizacion actualizacion;
    private String FEA;
   
    //REPORTEO
    //CABECERA
    private int numTasas = 0;
    private int numContribuciones = 0;
    private String cvePed = "";
    private String cveRegimen = "";
    private int cveDestino = 0;
    private String cveAduanaES = "";
    private String cveAduanaDespacho = "";
    private int cveTransporteES = 0;
    private int cveTransporteArribo = 0;
    private int cveTransporteSalida = 0;
    //DETALLE
    private String idCliente = "";
    private String idProvedor = "";
    private int numDescargos = 0;
    private int numTransporte = 0;
    private int numIdentificador = 0;
    private int numGuias = 0;
    private int numFechas = 0;
    private int numFacturas = 0;
    private int numDiferencias = 0;
    private int numCuentas = 0;
    private int numContenedores = 0;
    private int numObservaciones = 0;
    private int numpartidas = 0;
    private int numRectificaciones = 0;
    //TEMPORALES
    private Set rptCon = new TreeSet(); //RPT_CONTRIBUCION_PEDIMENTO
    private Set rptIden = new TreeSet(); //RPT_IDENTIFICADOR_PEDIMENTO
    private Set rptTasa = new TreeSet(); //RPT_TASA_PEDIMENTO


    //DESGLOSE
    private String colorBultosDesglose;
    private String colorPesoDesglose;
    private String colorVDDesglose;
    private String colorVCDesglose;
    private String colorVADesglose;
   
    private boolean bultosDesglose;
    private boolean pesoDesglose;
    private boolean valorDDesglose;
    private boolean valorCDesglose;
    private boolean valorADesglose;
   
    public Pedimento () {
        System.out.println("Inicializando pedimento");
        this.idPedimento = 0;
        this.tipoOperacion = "EXP";
        this.clavePedimento = new ClavePedimento();
        this.aduanaDespacho = new Aduana();
        this.aduanaEntradaSalida = new Aduana();
        this.regimen = new Regimen();
        this.destino = new Destino();
        this.transporteArribo = new MedioTransporte();
        this.transporteEntradaSalida = new MedioTransporte();
        this.transporteSalida = new MedioTransporte();
        this.cliente = new Cliente();
        this.provedor = new Provedor();
        this.patente = new AgenteAduanal();
        this.rectificacion = new RectificacionPedimento();
        this.actualizacion = new TipoActualizacion();
        this.FEA = new String();
        this.acuseElectronico = "NA";
        //desglose
        colorBultosDesglose = "red";
        colorPesoDesglose = "red";
        colorVDDesglose = "red";
        colorVCDesglose = "red";
        colorVADesglose = "red";
        bultosDesglose = false;
        pesoDesglose = false;
        valorDDesglose = false;
        valorCDesglose = false;
        valorADesglose = false;
    }

    public Set getRptCon() {
        return rptCon;
    }

    public void setRptCon(Set rptCon) {
        this.rptCon = rptCon;
    }

    public Set getRptIden() {
        return rptIden;
    }

    public void setRptIden(Set rptIden) {
        this.rptIden = rptIden;
    }

    public Set getRptTasa() {
        return rptTasa;
    }

    public void setRptTasa(Set rptTasa) {
        this.rptTasa = rptTasa;
    }

   

    public String getFEA() {
        return FEA;
    }

    public void setFEA(String FEA) {
        this.FEA = FEA;
    }

    public TipoActualizacion getActualizacion() {
        return actualizacion;
    }

    public void setActualizacion(TipoActualizacion actualizacion) {
        this.actualizacion = actualizacion;
    }

    public RectificacionPedimento getRectificacion() {
        return rectificacion;
    }

    public void setRectificacion(RectificacionPedimento rectificacion) {
        this.rectificacion = rectificacion;
    }

    public boolean isPesoDesglose() {
        return pesoDesglose;
    }

    public void setPesoDesglose(boolean pesoDesglose) {
        this.pesoDesglose = pesoDesglose;
    }

    public boolean isValorADesglose() {
        return valorADesglose;
    }

    public void setValorADesglose(boolean valorADesglose) {
        this.valorADesglose = valorADesglose;
    }

    public boolean isValorCDesglose() {
        return valorCDesglose;
    }

    public void setValorCDesglose(boolean valorCDesglose) {
        this.valorCDesglose = valorCDesglose;
    }

    public boolean isValorDDesglose() {
        return valorDDesglose;
    }

    public void setValorDDesglose(boolean valorDDesglose) {
        this.valorDDesglose = valorDDesglose;
    }

    public boolean isBultosDesglose() {
        return bultosDesglose;
    }

    public void setBultosDesglose(boolean bultosDesglose) {
        this.bultosDesglose = bultosDesglose;
    }
   
    public String getColorBultosDesglose() {
        return colorBultosDesglose;
    }

    public void setColorBultosDesglose(String colorBultosDesglose) {
        this.colorBultosDesglose = colorBultosDesglose;
    }

    public String getColorVADesglose() {
        return colorVADesglose;
    }

    public void setColorVADesglose(String colorVADesglose) {
        this.colorVADesglose = colorVADesglose;
    }

    public String getColorVCDesglose() {
        return colorVCDesglose;
    }

    public void setColorVCDesglose(String colorVCDesglose) {
        this.colorVCDesglose = colorVCDesglose;
    }

    public String getColorVDDesglose() {
        return colorVDDesglose;
    }

    public void setColorVDDesglose(String colorVDDesglose) {
        this.colorVDDesglose = colorVDDesglose;
    }

    public String getColorPesoDesglose() {
        return colorPesoDesglose;
    }

    public void setColorPesoDesglose(String colorPesoDesglose) {
        this.colorPesoDesglose = colorPesoDesglose;
    }

    public int getNumRectificaciones() {
        return numRectificaciones;
    }

    public void setNumRectificaciones(int numRectificaciones) {
        this.numRectificaciones = numRectificaciones;
    }

   
    public String getCveAduanaDespacho() {
        return cveAduanaDespacho;
    }

    public void setCveAduanaDespacho(String cveAduanaDespacho) {
        this.cveAduanaDespacho = cveAduanaDespacho;
    }

    public String getCveAduanaES() {
        return cveAduanaES;
    }

    public void setCveAduanaES(String cveAduanaES) {
        this.cveAduanaES = cveAduanaES;
    }

    public int getCveDestino() {
        return cveDestino;
    }

    public void setCveDestino(int cveDestino) {
        this.cveDestino = cveDestino;
    }

    public String getCvePed() {
        return cvePed;
    }

    public void setCvePed(String cvePed) {
        this.cvePed = cvePed;
    }

    public String getCveRegimen() {
        return cveRegimen;
    }

    public void setCveRegimen(String cveRegimen) {
        this.cveRegimen = cveRegimen;
    }

    public int getCveTransporteArribo() {
        return cveTransporteArribo;
    }

    public void setCveTransporteArribo(int cveTransporteArribo) {
        this.cveTransporteArribo = cveTransporteArribo;
    }

    public int getCveTransporteES() {
        return cveTransporteES;
    }

    public void setCveTransporteES(int cveTransporteES) {
        this.cveTransporteES = cveTransporteES;
    }

    public int getCveTransporteSalida() {
        return cveTransporteSalida;
    }

    public void setCveTransporteSalida(int cveTransporteSalida) {
        this.cveTransporteSalida = cveTransporteSalida;
    }
   
    public int getNumContribuciones() {
        return numContribuciones;
    }

    public void setNumContribuciones(int numContribuciones) {
        this.numContribuciones = numContribuciones;
    }

    public int getNumCuentas() {
        return numCuentas;
    }

    public void setNumCuentas(int numCuentas) {
        this.numCuentas = numCuentas;
    }

    public int getNumDescargos() {
        return numDescargos;
    }

    public void setNumDescargos(int numDescargos) {
        this.numDescargos = numDescargos;
    }

    public int getNumDiferencias() {
        return numDiferencias;
    }

    public void setNumDiferencias(int numDiferencias) {
        this.numDiferencias = numDiferencias;
    }

    public int getNumFacturas() {
        return numFacturas;
    }

    public void setNumFacturas(int numFacturas) {
        this.numFacturas = numFacturas;
    }

    public int getNumFechas() {
        return numFechas;
    }

    public void setNumFechas(int numFechas) {
        this.numFechas = numFechas;
    }

    public int getNumGuias() {
        return numGuias;
    }

    public void setNumGuias(int numGuias) {
        this.numGuias = numGuias;
    }

    public int getNumIdentificador() {
        return numIdentificador;
    }

    public void setNumIdentificador(int numIdentificador) {
        this.numIdentificador = numIdentificador;
    }

    public int getNumObservaciones() {
        return numObservaciones;
    }

    public void setNumObservaciones(int numObservaciones) {
        this.numObservaciones = numObservaciones;
    }

    public int getNumTasas() {
        return numTasas;
    }

    public void setNumTasas(int numTasas) {
        this.numTasas = numTasas;
    }

    public int getNumTransporte() {
        return numTransporte;
    }

    public void setNumTransporte(int numTransporte) {
        this.numTransporte = numTransporte;
    }

    public int getNumpartidas() {
        return numpartidas;
    }

    public void setNumpartidas(int numpartidas) {
        this.numpartidas = numpartidas;
    }
   
    public int getNumContenedores() {
        return numContenedores;
    }

    public void setNumContenedores(int numContenedores) {
        this.numContenedores = numContenedores;
    }

    public String getIdProvedor() {
        return idProvedor;
    }

    public void setIdProvedor(String idProvedor) {
        this.idProvedor = idProvedor;
    }

    public String getIdCliente() {
        return idCliente;
    }

    public void setIdCliente(String idCliente) {
        this.idCliente = idCliente;
    }
   
   

    public long getIdPedimento() {
        return idPedimento;
    }

    public void setIdPedimento(long idPedimento) {
        this.idPedimento = idPedimento;
    }

    public String getAcuseElectronico() {
        return acuseElectronico;
    }

    public void setAcuseElectronico(String acuseElectronico) {
        this.acuseElectronico = acuseElectronico;
    }
   
    public ClavePedimento getClavePedimento() {
        return clavePedimento;
    }

    public void setClavePedimento(ClavePedimento clavePedimento) {
        this.clavePedimento = clavePedimento;
    }

    public Cliente getCliente() {
        return cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    public Set getContenedor() {
        return contenedor;
    }

    public void setContenedor(Set contenedor) {
        this.contenedor = contenedor;
    }

    /*public Contribucion getContribucion() {
        return contribucion;
    }

    public void setContribucion(Contribucion contribucion) {
        this.contribucion = contribucion;
    }*/

    public Set getCuentaPedimento() {
        return cuentaPedimento;
    }

    public void setCuentaPedimento(Set cuentaPedimento) {
        this.cuentaPedimento = cuentaPedimento;
    }

    public Destino getDestino() {
        return destino;
    }

    public void setDestino(Destino destino) {
        this.destino = destino;
    }

    public Set getDiferencia() {
        return diferencia;
    }

    public void setDiferencia(Set diferencia) {
        this.diferencia = diferencia;
    }

    public double getEfectivo() {
        return efectivo;
    }

    public void setEfectivo(double efectivo) {
        this.efectivo = efectivo;
    }

    public Set getFactura() {
        return factura;
    }

    public void setFactura(Set factura) {
        this.factura = factura;
    }

    public Set getFecha() {
        return fecha;
    }

    public void setFecha(Set fecha) {
        this.fecha = fecha;
    }

    public FormaPago getFormaPago() {
        return formaPago;
    }

    public void setFormaPago(FormaPago formaPago) {
        this.formaPago = formaPago;
    }

    public Set getGuia() {
        return guia;
    }

    public void setGuia(Set guia) {
        this.guia = guia;
    }

    public Set getIdentificador() {
        return identificador;
    }

    public void setIdentificador(Set identificador) {
        this.identificador = identificador;
    }

    public double getImporte() {
        return importe;
    }

    public void setImporte(double importe) {
        this.importe = importe;
    }

    public Moneda getMoneda() {
        return moneda;
    }

    public void setMoneda(Moneda moneda) {
        this.moneda = moneda;
    }

    public Set getObservacion() {
        return observacion;
    }

    public void setObservacion(Set observacion) {
        this.observacion = observacion;
    }

    public double getOtros() {
        return otros;
    }

    public void setOtros(double otros) {
        this.otros = otros;
    }

    public Set getPartidaPedimento() {
        return partidaPedimento;
    }

    public void setPartidaPedimento(Set partidaPedimento) {
        this.partidaPedimento = partidaPedimento;
    }

    public AgenteAduanal getPatente() {
        return patente;
    }

    public void setPatente(AgenteAduanal patente) {
        this.patente = patente;
    }

    public double getPesoBruto() {
        return pesoBruto;
    }

    public void setPesoBruto(double pesoBruto) {
        this.pesoBruto = pesoBruto;
    }

    public Provedor getProvedor() {
        return provedor;
    }

    public void setProvedor(Provedor provedor) {
        this.provedor = provedor;
    }

    public Regimen getRegimen() {
        return regimen;
    }

    public void setRegimen(Regimen regimen) {
        this.regimen = regimen;
    }

    public String getTipoOperacion() {
        return tipoOperacion;
    }

    public void setTipoOperacion(String tipoOperacion) {
        this.tipoOperacion = tipoOperacion;
    }

   

    public double getTipoCambio() {
        return tipoCambio;
    }

    public void setTipoCambio(double tipoCambio) {
        this.tipoCambio = tipoCambio;
    }

    public int getTipoTasa() {
        return tipoTasa;
    }

    public void setTipoTasa(int tipoTasa) {
        this.tipoTasa = tipoTasa;
    }

    public double getTotal() {
        return total;
    }

    public void setTotal(double total) {
        this.total = total;
    }

    public Set getTransporte() {
        return transporte;
    }

    public void setTransporte(Set transporte) {
        this.transporte = transporte;
    }

    public MedioTransporte getTransporteArribo() {
        return transporteArribo;
    }

    public void setTransporteArribo(MedioTransporte transporteArribo) {
        this.transporteArribo = transporteArribo;
    }

   

    public MedioTransporte getTransporteSalida() {
        return transporteSalida;
    }

    public void setTransporteSalida(MedioTransporte transporteSalida) {
        this.transporteSalida = transporteSalida;
    }

    public double getValorAduana() {
        return valorAduana;
    }

    public void setValorAduana(double valorAduana) {
        this.valorAduana = valorAduana;
    }

    public double getValorDolares() {
        return valorDolares;
    }

    public void setValorDolares(double valorDolares) {
        this.valorDolares = valorDolares;
    }

    public Aduana getAduanaDespacho() {
        //System.out.println(this.aduanaDespacho);
        return aduanaDespacho;
    }

    public void setAduanaDespacho(Aduana aduanaDespacho) {
        this.aduanaDespacho = aduanaDespacho;
    }

    public double getEmbalajes() {
        return embalajes;
    }

    public void setEmbalajes(double embalajes) {
        this.embalajes = embalajes;
    }

    public double getFletes() {
        return fletes;
    }

    public void setFletes(double fletes) {
        this.fletes = fletes;
    }

    public double getIncrementables() {
        return incrementables;
    }

    public void setIncrementables(double incrementables) {
        this.incrementables = incrementables;
    }

    public double getPrimasSeguros() {
        return primasSeguros;
    }

    public void setPrimasSeguros(double primasSeguros) {
        this.primasSeguros = primasSeguros;
    }

    public Set getContribucion() {
        //System.out.println("CONTRIBUCIONES: " + contribucion.size());
        return contribucion;
    }

    public void setContribucion(Set contribucion) {
        this.contribucion = contribucion;
    }

    public Set getTasa() {
        return tasa;
    }

    public void setTasa(Set tasa) {
        this.tasa = tasa;
    }

    public Set getDescargo() {
        return descargo;
    }

    public void setDescargo(Set descargo) {
        this.descargo = descargo;
    }

    public double getValorSeguros() {
        return valorSeguros;
    }

    public void setValorSeguros(double valorSeguros) {
        this.valorSeguros = valorSeguros;
    }

    public Aduana getAduanaEntradaSalida() {
        //System.out.print(this.aduanaEntradaSalida);
        return aduanaEntradaSalida;
    }

    public void setAduanaEntradaSalida(Aduana aduanaEntradaSalida) {
        this.aduanaEntradaSalida = aduanaEntradaSalida;
    }

    public MedioTransporte getTransporteEntradaSalida() {
        return transporteEntradaSalida;
    }

    public void setTransporteEntradaSalida(MedioTransporte transporteEntradaSalida) {
        this.transporteEntradaSalida = transporteEntradaSalida;
    }

    public double getBultos() {
        return bultos;
    }

    public void setBultos(double bultos) {
        this.bultos = bultos;
    }

    public String getMarcas() {
        return marcas;
    }

    public void setMarcas(String marcas) {
        this.marcas = marcas;
    }

    public String getNumeros() {
        return numeros;
    }

    public void setNumeros(String numeros) {
        this.numeros = numeros;
    }

    public Date getFechaCaptura() {
        return fechaCaptura;
    }

    public void setFechaCaptura(Date fechaCaptura) {
        this.fechaCaptura = fechaCaptura;
    }

    public double getValorFacturas() {       
        return valorFacturas;
    }

    public void setValorFacturas(double valorFacturas) {
        this.valorFacturas = valorFacturas;
    }

    public double getValorComercial() {
        return valorComercial;
    }

    public void setValorComercial(double valorComercial) {
        this.valorComercial = valorComercial;
    }
   

    public long getFolioCC() {
        return folioCC;
    }

    public void setFolioCC(long folioCC) {
        this.folioCC = folioCC;
    }
   
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Pedimento other = (Pedimento) obj;
        if (this.idPedimento != other.idPedimento) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 23 * hash + (int) (this.idPedimento ^ (this.idPedimento >>> 32));
        return hash;
    }

    public int compareTo(Object o) {
        if(!this.equals(o))
            return 0;
       
        return -1;
    }

    public void calculaTotales(){
        if(this.contribucion.size() > 0){
            Iterator itc = this.contribucion.iterator();
            while(itc.hasNext()){
                ContribucionPedimento cp = (ContribucionPedimento)itc.next();
                if(cp.getFormaPago().getClaveFormaPago() == 0)
                    this.efectivo += cp.getImporte();
                else
                    this.otros += cp.getImporte();
            }
            this.total = this.otros + this.efectivo;
        }
        Iterator itfact = getFactura().iterator();
        while(itfact.hasNext())
            valorFacturas += ((Factura)itfact.next()).getValorTotalDlls();
    }
   
    public java.sql.ResultSet getPedimento(){ //  Pedimento []data){
        Pedimento[] data = {new Pedimento()};
        data[0].setIdPedimento(new Long("84330208003440"));
        llenaReporte(data[0]);
        ResultSet results = null;
        POJOResultSetFactory factory = null;
        try{
            factory = new POJOResultSetFactory(Class.forName("Comercio.Pedimento.Pedimento"));
        }
        catch(Exception e){
                e.printStackTrace();
        }
        results = factory.createResultSet(data);
        return results;
    }

    public void llenaReporte(Pedimento pedimento){
        pedimento.setIdCliente(pedimento.getCliente().getId_cliente());
        pedimento.setIdProvedor(pedimento.getProvedor().getIdProvedor());
        pedimento.setCveAduanaDespacho(pedimento.getAduanaDespacho().getAduanaSeccion());
        pedimento.setCveAduanaES(pedimento.getAduanaDespacho().getAduanaSeccion());
        pedimento.setCveDestino(pedimento.getDestino().getClaveDestino());
        pedimento.setCveRegimen(pedimento.getRegimen().getClaveRegimen());
        pedimento.setCveTransporteArribo(pedimento.getTransporteArribo().getClaveTransporte());
        pedimento.setCveTransporteES(pedimento.getTransporteEntradaSalida().getClaveTransporte());
        pedimento.setCveTransporteSalida(pedimento.getTransporteSalida().getClaveTransporte());
        pedimento.setCvePed(pedimento.getClavePedimento().getClavePedimento());
        pedimento.setNumFacturas(pedimento.getFactura().size());
        pedimento.setNumTransporte(pedimento.getTransporte().size());
        pedimento.setNumGuias(pedimento.getGuia().size());
        pedimento.setNumContenedores(pedimento.getContenedor().size());
        pedimento.setNumIdentificador(pedimento.getDescargo().size());
        pedimento.setNumObservaciones(pedimento.getObservacion().size());
    }

}


*********IDENTIFICADOR

package Comercio.Pedimento;

import java.io.Serializable;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class IdentificadorPedimento implements Serializable, Comparable{
    private long idPedimento;
    private int idIdentificador;   
    private Identificador identificador;
    private Set complementoPedimento = new TreeSet();
   
    private String complemento1;
    private String complemento2;
    private String complemento3;

    private Pedimento pedimento;

    private boolean marcado;
   
    public IdentificadorPedimento () {
        this.complemento1 = "";
        this.complemento2 = "";
        this.complemento3 = "";
        this.complementoPedimento = new TreeSet();
        this.idPedimento = 0;
        this.idIdentificador = 0;
        this.identificador = new Identificador();
    }

    public Pedimento getPedimento() {
        return pedimento;
    }

    public void setPedimento(Pedimento pedimento) {
        this.pedimento = pedimento;
    }

    public Set getComplementoPedimento() {
        return complementoPedimento;
    }

    public void setComplementoPedimento(Set complementoPedimento) {
        this.complementoPedimento = complementoPedimento;
    }

    public int getIdIdentificador(){
        return idIdentificador;
    }

    public void setIdIdentificador(int idIdentificador) {
        this.idIdentificador = idIdentificador;
    }

    public long getIdPedimento() {
        return idPedimento;
    }

    public void setIdPedimento(long idPedimento) {
        this.idPedimento = idPedimento;
    }

    public Identificador getIdentificador() {
        return identificador;
    }

    public void setIdentificador(Identificador identificador) {
        this.identificador = identificador;
    }

    public String getComplemento1() {
        complemento1 = "";
        if(this.complementoPedimento.size() >= 1){
            Iterator itCom = this.complementoPedimento.iterator();
            complemento1 = ((ComplementoPedimento)itCom.next()).getComplemento();
        }
        return complemento1;
    }

    public void setComplemento1(String complemento1) {
        this.complemento1 = complemento1;
        ComplementoPedimento com = new ComplementoPedimento();
        com.setComplemento(complemento1);
        com.setIdentificadorPedimento(this);
        this.complementoPedimento.add(com);
    }

    public String getComplemento2() {
        complemento2 = "";
        if(this.complementoPedimento.size() >= 2){
            Iterator itCom = this.complementoPedimento.iterator();
            complemento1 = ((ComplementoPedimento)itCom.next()).getComplemento();
            complemento2 = ((ComplementoPedimento)itCom.next()).getComplemento();
        }
        return complemento2;
    }

    public void setComplemento2(String complemento2) {
        this.complemento2 = complemento2;
        ComplementoPedimento com = new ComplementoPedimento();
        com.setComplemento(complemento2);
        com.setIdentificadorPedimento(this);
        this.complementoPedimento.add(com);
    }

    public String getComplemento3() {
        complemento3 = "";
        if(this.complementoPedimento.size() >= 3){
            Iterator itCom = this.complementoPedimento.iterator();
            complemento1 = ((ComplementoPedimento)itCom.next()).getComplemento();
            complemento2 = ((ComplementoPedimento)itCom.next()).getComplemento();
            complemento3 = ((ComplementoPedimento)itCom.next()).getComplemento();
        }
        return complemento3;
    }

    public void setComplemento3(String complemento3) {
        this.complemento3 = complemento3;
        ComplementoPedimento com = new ComplementoPedimento();
        com.setComplemento(complemento3);
        com.setIdentificadorPedimento(this);
        this.complementoPedimento.add(com);
    }
   
   

    public boolean isMarcado() {
        return marcado;
    }

    public void setMarcado(boolean marcado) {
        this.marcado = marcado;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final IdentificadorPedimento other = (IdentificadorPedimento) obj;
        if (this.idPedimento != other.idPedimento) {
            return false;
        }
        if (this.idIdentificador != other.idIdentificador) {
            return false;
        }
        if (this.identificador != other.identificador && (this.identificador == null || !this.identificador.equals(other.identificador))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 71 * hash + (int) (this.idPedimento ^ (this.idPedimento >>> 32));
        hash = 71 * hash + this.idIdentificador;
        hash = 71 * hash + (this.identificador != null ? this.identificador.hashCode() : 0);
        return hash;
    }

    public int compareTo(Object o) {
        if(this.equals(o))
            return 0;
        return -1;
    }   
}


***************COMPLEMENTO

package Comercio.Pedimento;

import java.io.Serializable;


public class ComplementoPedimento implements Comparable, Serializable {
    private long idComplemento;
    private int idIdentificador;
    private long idPedimento;
    private ComplementoIdentificador complementoIdentificador;
    private String complemento;
    private String descripcion;
    private boolean marcado;

    IdentificadorPedimento identificadorPedimento;

    public ComplementoPedimento () {
        this.idComplemento = 0;
        this.idIdentificador = 0;
        this.idPedimento = 0;
        this.complemento = "";
        this.descripcion = "";
    }

    public IdentificadorPedimento getIdentificadorPedimento() {
        return identificadorPedimento;
    }

    public void setIdentificadorPedimento(IdentificadorPedimento identificadorPedimento) {
        this.identificadorPedimento = identificadorPedimento;
    }

    public boolean isMarcado() {
        return marcado;
    }

    public void setMarcado(boolean marcado) {
        this.marcado = marcado;
    }

   
   
    public int getIdIdentificador() {
        return idIdentificador;
    }

    public void setIdIdentificador(int idIdentificador) {
        this.idIdentificador = idIdentificador;
    }

    public String getComplemento() {
        return complemento;
    }

    public void setComplemento(String complemento) {
        this.complemento = complemento;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public ComplementoIdentificador getComplementoIdentificador() {
        return complementoIdentificador;
    }

    public void setComplementoIdentificador(ComplementoIdentificador complementoIdentificador) {
        this.complementoIdentificador = complementoIdentificador;
    }

    public long getIdComplemento() {
        return idComplemento;
    }

    public void setIdComplemento(long idComplemento) {
        this.idComplemento = idComplemento;
    }

    public long getIdPedimento() {
        return idPedimento;
    }

    public void setIdPedimento(long idPedimento) {
        this.idPedimento = idPedimento;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ComplementoPedimento other = (ComplementoPedimento) obj;
        if (this.idComplemento != other.idComplemento) {
            return false;
        }
        if (this.idIdentificador != other.idIdentificador) {
            return false;
        }
        if (this.idPedimento != other.idPedimento) {
            return false;
        }
        if ((this.complemento == null) ? (other.complemento != null) : !this.complemento.equals(other.complemento)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 83 * hash + (int) (this.idComplemento ^ (this.idComplemento >>> 32));
        hash = 83 * hash + this.idIdentificador;
        hash = 83 * hash + (int) (this.idPedimento ^ (this.idPedimento >>> 32));
        hash = 83 * hash + (this.complemento != null ? this.complemento.hashCode() : 0);
        return hash;
    }

   
   
   

    public int compareTo(Object o) {
        if(this.equals(o))
            return 0;
        return -1;
    }
   
   
   
}





Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.