I have two xml files with the following mapping:
<class name="com.chep.ams.vo.events.EventLineVO" table="EVENT_LINE"> <composite-id name="id" class="com.chep.ams.vo.events.EventLineVOId"> <key-property name="eventId" type="long"> <column name="EVENT_ID" precision="38" scale="0" /> </key-property> <key-property name="eventLineId" type="long"> <column name="EVENT_LINE_ID" /> </key-property> </composite-id> <set name="eventAssetDispositions" lazy="false" table="EVENT_ASSET_DISPOSITION" fetch="select"> <key> <column name="EVENT_ID" precision="38" scale="0" not-null="true" /> <column name="EVENT_LINE_ID" not-null="true" /> </key> <one-to-many class="com.chep.ams.vo.events.EventAssetDisposition" /> </set>
and
<class name="com.chep.ams.vo.events.EventAssetDisposition" table="EVENT_ASSET_DISPOSITION"> <composite-id name="id" class="com.chep.ams.vo.events.EventAssetDispositionId"> <key-property name="eventId" type="long"> <column name="EVENT_ID" precision="38" scale="0" not-null="true"/> </key-property> <key-property name="eventLineId" type="long"> <column name="EVENT_LINE_ID" not-null="true" /> </key-property> <key-property name="assetKey" type="long"> <column name="ASSET_KEY" precision="38" scale="0" not-null="true"/> </key-property> </composite-id>
<many-to-one name="eventLineVO" class="com.chep.ams.vo.events.EventLineVO" update="false" insert="false" fetch="select" > <column name="EVENT_ID" precision="38" scale="0" not-null="true" /> <column name="EVENT_LINE_ID" not-null="true" /> </many-to-one>
I'm entering values into the EVENT_LINE table and then with the EVENT_LINE_ID am forming the EVENT_ASSET_DISPOSITION rows.
I'm getting the following stack:
"10:23:58,230 INFO [STDOUT] Hibernate: insert into EVENT_LINE (CHILD_ASSET_TYPE, PACK_SPEC_ID, GRAND_PARENT_PACK_REF, GRAND_PARENT_CUST_REF, PARENT_PACK_REF, PARENT_CUST_REF, PACK_TYPE, PACK_LEVEL, EXPECTED_QTY, ACTUAL_QTY, MANUAL_QTY, EVENT_ID, EVENT_LINE_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 10:23:58,381 INFO [STDOUT] Hibernate: insert into EVENT_ASSET_DISPOSITION (PREV_EVENT_ID, PREV_LOC_ID, PREV_REFERENCE_NBR, ASSET_TYPE_ID, DISPOSITION_ID, EVENT_ID, EVENT_LINE_ID, ASSET_KEY) values (?, ?, ?, ?, ?, ?, ?, ?) 10:23:58,582 INFO [STDOUT] Hibernate: insert into EVENT_ASSET_DISPOSITION (PREV_EVENT_ID, PREV_LOC_ID, PREV_REFERENCE_NBR, ASSET_TYPE_ID, DISPOSITION_ID, EVENT_ID, EVENT_LINE_ID, ASSET_KEY) values (?, ?, ?, ?, ?, ?, ?, ?) 10:23:58,731 INFO [STDOUT] Hibernate: insert into EVENT_ASSET_DISPOSITION (PREV_EVENT_ID, PREV_LOC_ID, PREV_REFERENCE_NBR, ASSET_TYPE_ID, DISPOSITION_ID, EVENT_ID, EVENT_LINE_ID, ASSET_KEY) values (?, ?, ?, ?, ?, ?, ?, ?) 10:23:58,881 INFO [STDOUT] Hibernate: insert into EVENT_CONTENT_ATTRIBUTE (ASSET_TYPE_ID, ATTRIBUTE_VALUE, EVENT_ID, EVENT_LINE_ID, ASSET_KEY, ATTRIBUTE_ID) values (?, ?, ?, ?, ?, ?) 10:23:59,125 INFO [STDOUT] Hibernate: update EVENT_ASSET_DISPOSITION set EVENT_ID=null, EVENT_LINE_ID=null where EVENT_ID=? and EVENT_LINE_ID=? 10:23:59,292 WARN [JDBCExceptionReporter] SQL Error: 233, SQLState: 23000 10:23:59,293 ERROR [JDBCExceptionReporter] The column EVENT_ID in table EVENT_ASSET_DISPOSITION does not allow null values.
10:23:59,293 WARN [JDBCExceptionReporter] SQL Error: 233, SQLState: 23000 10:23:59,293 ERROR [JDBCExceptionReporter] The column EVENT_LINE_ID in table EVENT_ASSET_DISPOSITION does not allow null values.
10:23:59,293 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: could not delete collection: [com.chep.ams.vo.events.EventLineVO.eventAssetDispositions#component[eventId,eventLineId]{eventLineId=1, eventId=5222}] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1093) at org.hibernate.action.CollectionRemoveAction.execute(CollectionRemoveAction.java:107) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:169) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027) at org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCommit(SpringSessionSynchronization.java:135) at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:48) at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:835) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:645) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:319) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy461.createMergedEvent(Unknown Source) at com.chep.ams.controller.cpg.RetroSearchDocController.merge(RetroSearchDocController.java:514) at com.chep.ams.controller.cpg.RetroSearchDocController.onSubmit(RetroSearchDocController.java:225) at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:267) at org.springframework.web.servlet.mvc.CancellableFormController.processFormSubmission(CancellableFormController.java:140) at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:265) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source) Caused by: com.sybase.jdbc3.jdbc.SybSQLException: The column EVENT_ID in table EVENT_ASSET_DISPOSITION does not allow null values.
at com.sybase.jdbc3.tds.Tds.a(Unknown Source) at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.updateLoop(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.executeUpdate(Unknown Source) at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeUpdate(Unknown Source) at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:365) at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46) at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1070) ... 52 more 10:23:59,506 ERROR [ErrorLogger] TIME STAMP :2010-12-21 10:23:59,498 UNIQUE ERROR ID : -2020416987 USER : 0 SCREEN NAME : null CLASS NAME : org.springframework.orm.hibernate3.SessionFactoryUtils METHOD NAME : convertHibernateAccessException ERROR MESSAGE : System Error. Please report this to administrator USER MESSAGE :System Error. Please report this to administrator
org.springframework.dao.DataIntegrityViolationException: could not delete collection: [com.chep.ams.vo.events.EventLineVO.eventAssetDispositions#component[eventId,eventLineId]{eventLineId=1, eventId=5222}]; nested exception is org.hibernate.exception.ConstraintViolationException: could not delete collection: [com.chep.ams.vo.events.EventLineVO.eventAssetDispositions#component[eventId,eventLineId]{eventLineId=1, eventId=5222}] at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:622) at org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCommit(SpringSessionSynchronization.java:143) at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:48) at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:835) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:645) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:319) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy461.createMergedEvent(Unknown Source) at com.chep.ams.controller.cpg.RetroSearchDocController.merge(RetroSearchDocController.java:514) at com.chep.ams.controller.cpg.RetroSearchDocController.onSubmit(RetroSearchDocController.java:225) at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:267) at org.springframework.web.servlet.mvc.CancellableFormController.processFormSubmission(CancellableFormController.java:140) at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:265) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source) Caused by: org.hibernate.exception.ConstraintViolationException: could not delete collection: [com.chep.ams.vo.events.EventLineVO.eventAssetDispositions#component[eventId,eventLineId]{eventLineId=1, eventId=5222}] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1093) at org.hibernate.action.CollectionRemoveAction.execute(CollectionRemoveAction.java:107) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:169) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027) at org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCommit(SpringSessionSynchronization.java:135) ... 44 more Caused by: com.sybase.jdbc3.jdbc.SybSQLException: The column EVENT_ID in table EVENT_ASSET_DISPOSITION does not allow null values.
at com.sybase.jdbc3.tds.Tds.a(Unknown Source) at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.updateLoop(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.executeUpdate(Unknown Source) at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeUpdate(Unknown Source) at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:365) at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46) at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1070) ... 52 more"
Can anyone help me on this???
_________________ Cheap SEO India
Best SEO company
|