Spring Data JPA deleteInBatch -
while delete(list) working fine, if try delete deleteinbatch(list), thowing exception below
org.springframework.dao.dataintegrityviolationexception: not execute statement; sql [n/a]; constraint [dept_details_f_key1]; nested exception org.hibernate.exception.constraintviolationexception: not execute statement @ org.springframework.orm.jpa.vendor.hibernatejpadialect.converthibernateaccessexception(hibernatejpadialect.java:248) @ org.springframework.orm.jpa.vendor.hibernatejpadialect.translateexceptionifpossible(hibernatejpadialect.java:214) @ org.springframework.orm.jpa.abstractentitymanagerfactorybean.translateexceptionifpossible(abstractentitymanagerfactorybean.java:417) @ org.springframework.dao.support.chainedpersistenceexceptiontranslator.translateexceptionifpossible(chainedpersistenceexceptiontranslator.java:59) @ org.springframework.dao.support.dataaccessutils.translateifnecessary(dataaccessutils.java:213) @ org.springframework.dao.support.persistenceexceptiontranslationinterceptor.invoke(persistenceexceptiontranslationinterceptor.java:147) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.data.jpa.repository.support.crudmethodmetadatapostprocessor$crudmethodmetadatapopulatingmethodintercceptor.invoke(crudmethodmetadatapostprocessor.java:111) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.aop.interceptor.exposeinvocationinterceptor.invoke(exposeinvocationinterceptor.java:92) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.aop.framework.jdkdynamicaopproxy.invoke(jdkdynamicaopproxy.java:207) @ com.sun.proxy.$proxy46.deleteallinbatch(unknown source) @ com.test.deletedepttest.deletedeptsinbatch(deletedepttest.java:94) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.junit.runners.model.frameworkmethod$1.runreflectivecall(frameworkmethod.java:47) @ org.junit.internal.runners.model.reflectivecallable.run(reflectivecallable.java:12) @ org.junit.runners.model.frameworkmethod.invokeexplosively(frameworkmethod.java:44) @ org.junit.internal.runners.statements.invokemethod.evaluate(invokemethod.java:17) @ org.springframework.test.context.junit4.statements.runbeforetestmethodcallbacks.evaluate(runbeforetestmethodcallbacks.java:73) @ org.springframework.test.context.junit4.statements.runaftertestmethodcallbacks.evaluate(runaftertestmethodcallbacks.java:82) @ org.springframework.test.context.junit4.statements.springrepeat.evaluate(springrepeat.java:73) @ org.junit.runners.parentrunner.runleaf(parentrunner.java:271) @ org.springframework.test.context.junit4.springjunit4classrunner.runchild(springjunit4classrunner.java:217) @ org.springframework.test.context.junit4.springjunit4classrunner.runchild(springjunit4classrunner.java:83) @ org.junit.runners.parentrunner$3.run(parentrunner.java:238) @ org.junit.runners.parentrunner$1.schedule(parentrunner.java:63) @ org.junit.runners.parentrunner.runchildren(parentrunner.java:236) @ org.junit.runners.parentrunner.access$000(parentrunner.java:53) @ org.junit.runners.parentrunner$2.evaluate(parentrunner.java:229) @ org.springframework.test.context.junit4.statements.runbeforetestclasscallbacks.evaluate(runbeforetestclasscallbacks.java:61) @ org.springframework.test.context.junit4.statements.runaftertestclasscallbacks.evaluate(runaftertestclasscallbacks.java:68) @ org.junit.runners.parentrunner.run(parentrunner.java:309) @ org.springframework.test.context.junit4.springjunit4classrunner.run(springjunit4classrunner.java:163) @ org.eclipse.jdt.internal.junit4.runner.junit4testreference.run(junit4testreference.java:50) @ org.eclipse.jdt.internal.junit.runner.testexecution.run(testexecution.java:38) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.runtests(remotetestrunner.java:459) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.runtests(remotetestrunner.java:675) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.run(remotetestrunner.java:382) @ org.eclipse.jdt.internal.junit.runner.remotetestrunner.main(remotetestrunner.java:192) caused by: org.hibernate.exception.constraintviolationexception: not execute statement @ org.hibernate.exception.internal.sqlexceptiontypedelegate.convert(sqlexceptiontypedelegate.java:72) @ org.hibernate.exception.internal.standardsqlexceptionconverter.convert(standardsqlexceptionconverter.java:49) @ org.hibernate.engine.jdbc.spi.sqlexceptionhelper.convert(sqlexceptionhelper.java:126) @ org.hibernate.engine.jdbc.spi.sqlexceptionhelper.convert(sqlexceptionhelper.java:112) @ org.hibernate.engine.jdbc.internal.resultsetreturnimpl.executeupdate(resultsetreturnimpl.java:211) @ org.hibernate.hql.internal.ast.exec.basicexecutor.doexecute(basicexecutor.java:109) @ org.hibernate.hql.internal.ast.exec.basicexecutor.execute(basicexecutor.java:78) @ org.hibernate.hql.internal.ast.exec.deleteexecutor.execute(deleteexecutor.java:125) @ org.hibernate.hql.internal.ast.querytranslatorimpl.executeupdate(querytranslatorimpl.java:445) @ org.hibernate.engine.query.spi.hqlqueryplan.performexecuteupdate(hqlqueryplan.java:379) @ org.hibernate.internal.sessionimpl.executeupdate(sessionimpl.java:1286) @ org.hibernate.internal.queryimpl.executeupdate(queryimpl.java:118) @ org.hibernate.jpa.internal.queryimpl.internalexecuteupdate(queryimpl.java:371) @ org.hibernate.jpa.spi.abstractqueryimpl.executeupdate(abstractqueryimpl.java:78) @ org.springframework.data.jpa.repository.support.simplejparepository.deleteallinbatch(simplejparepository.java:206) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.springframework.data.repository.core.support.repositoryfactorysupport$queryexecutormethodinterceptor.executemethodon(repositoryfactorysupport.java:442) @ org.springframework.data.repository.core.support.repositoryfactorysupport$queryexecutormethodinterceptor.doinvoke(repositoryfactorysupport.java:427) @ org.springframework.data.repository.core.support.repositoryfactorysupport$queryexecutormethodinterceptor.invoke(repositoryfactorysupport.java:381) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.transaction.interceptor.transactioninterceptor$1.proceedwithinvocation(transactioninterceptor.java:99) @ org.springframework.transaction.interceptor.transactionaspectsupport.invokewithintransaction(transactionaspectsupport.java:281) @ org.springframework.transaction.interceptor.transactioninterceptor.invoke(transactioninterceptor.java:96) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.dao.support.persistenceexceptiontranslationinterceptor.invoke(persistenceexceptiontranslationinterceptor.java:136) ... 37 more caused by: java.sql.sqlintegrityconstraintviolationexception: integrity constraint violation: foreign key no action; dept_details_f_key1 table: dept_details @ org.hsqldb.jdbc.jdbcutil.sqlexception(unknown source) @ org.hsqldb.jdbc.jdbcutil.sqlexception(unknown source) @ org.hsqldb.jdbc.jdbcpreparedstatement.fetchresult(unknown source) @ org.hsqldb.jdbc.jdbcpreparedstatement.executeupdate(unknown source) @ org.apache.commons.dbcp.delegatingpreparedstatement.executeupdate(delegatingpreparedstatement.java:105) @ org.apache.commons.dbcp.delegatingpreparedstatement.executeupdate(delegatingpreparedstatement.java:105) @ org.hibernate.engine.jdbc.internal.resultsetreturnimpl.executeupdate(resultsetreturnimpl.java:208) ... 60 more caused by: org.hsqldb.hsqlexception: integrity constraint violation: foreign key no action; dept_details_f_key1 table: dept_details @ org.hsqldb.error.error.error(unknown source) @ org.hsqldb.statementdml.performreferentialactions(unknown source) @ org.hsqldb.statementdml.delete(unknown source) @ org.hsqldb.statementdml.executedeletestatement(unknown source) @ org.hsqldb.statementdml.getresult(unknown source) @ org.hsqldb.statementdmql.execute(unknown source) @ org.hsqldb.session.executecompiledstatement(unknown source) @ org.hsqldb.session.execute(unknown source) ... 65 more
i modified classname , keys
Comments
Post a Comment