- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的数据库中有两个表:一个用于持久化用户,另一个用于保存他们的权限。
问题是,当我尝试删除用户时,必须删除权限,这样我才能避免收到违反约束的异常。我为此使用了 JPA 级联类型.ALL 和 orphanRemoval=true :
@OneToMany(fetch = FetchType.LAZY, mappedBy = "users",cascade = CascadeType.ALL,orphanRemoval = true)
public Set<Authorities> getAuthoritieses() {
return this.authoritieses;
}
sept. 07, 2015 7:42:14 AM com.sun.faces.lifecycle.InvokeApplicationPhase execute
Avertissement: #{listeEnvoiBean.suppListe()}: org.springframework.dao.DataIntegrityViolationException: ERREUR: UPDATE ou DELETE sur la table « liste_envoi » viole la contrainte de clé étrangère
« notifconfiglistefk » de la table « notification_config »
Détail : La clé (id)=(5) est toujours référencée à partir de la table « notification_config ».; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: ERREUR: UPDATE ou DELETE sur la table « liste_envoi » viole la contrainte de clé étrangère
« notifconfiglistefk » de la table « notification_config »
Détail : La clé (id)=(5) est toujours référencée à partir de la table « notification_config ».
javax.faces.FacesException: #{listeEnvoiBean.suppListe()}: org.springframework.dao.DataIntegrityViolationException: ERREUR: UPDATE ou DELETE sur la table « liste_envoi » viole la contrainte de clé étrangère
« notifconfiglistefk » de la table « notification_config »
Détail : La clé (id)=(5) est toujours référencée à partir de la table « notification_config ».; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: ERREUR: UPDATE ou DELETE sur la table « liste_envoi » viole la contrainte de clé étrangère
« notifconfiglistefk » de la table « notification_config »
Détail : La clé (id)=(5) est toujours référencée à partir de la table « notification_config ».
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
at org.springframework.faces.webflow.FlowActionListener.processAction(FlowActionListener.java:71)
at org.springframework.faces.model.SelectionTrackingActionListener.processAction(SelectionTrackingActionListener.java:64)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:654)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:64)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:744)
Caused by: javax.faces.el.EvaluationException: org.springframework.dao.DataIntegrityViolationException: ERREUR: UPDATE ou DELETE sur la table « liste_envoi » viole la contrainte de clé étrangère
« notifconfiglistefk » de la table « notification_config »
Détail : La clé (id)=(5) est toujours référencée à partir de la table « notification_config ».; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: ERREUR: UPDATE ou DELETE sur la table « liste_envoi » viole la contrainte de clé étrangère
« notifconfiglistefk » de la table « notification_config »
Détail : La clé (id)=(5) est toujours référencée à partir de la table « notification_config ».
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
... 66 more
Caused by: org.springframework.dao.DataIntegrityViolationException: ERREUR: UPDATE ou DELETE sur la table « liste_envoi » viole la contrainte de clé étrangère
« notifconfiglistefk » de la table « notification_config »
Détail : La clé (id)=(5) est toujours référencée à partir de la table « notification_config ».; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: ERREUR: UPDATE ou DELETE sur la table « liste_envoi » viole la contrainte de clé étrangère
« notifconfiglistefk » de la table « notification_config »
Détail : La clé (id)=(5) est toujours référencée à partir de la table « notification_config ».
at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:163)
at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:730)
at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:592)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:757)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:726)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:521)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:291)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy49.supprimer(Unknown Source)
at controller.reporting.ListeEnvoiBean.suppListe(ListeEnvoiBean.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.el.parser.AstValue.invoke(AstValue.java:247)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
... 67 more
Caused by: org.hibernate.exception.ConstraintViolationException: ERREUR: UPDATE ou DELETE sur la table « liste_envoi » viole la contrainte de clé étrangère
« notifconfiglistefk » de la table « notification_config »
Détail : La clé (id)=(5) est toujours référencée à partir de la table « notification_config ».
at org.hibernate.exception.internal.SQLStateConverter.convert(SQLStateConverter.java:104)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129)
at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
at com.sun.proxy.$Proxy77.executeUpdate(Unknown Source)
at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:56)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3124)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3327)
at org.hibernate.action.internal.EntityDeleteAction.execute(EntityDeleteAction.java:91)
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:273)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:265)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:191)
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:323)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1081)
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:315)
at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175)
at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:584)
... 84 more
Caused by: org.postgresql.util.PSQLException: ERREUR: UPDATE ou DELETE sur la table « liste_envoi » viole la contrainte de clé étrangère
« notifconfiglistefk » de la table « notification_config »
Détail : La clé (id)=(5) est toujours référencée à partir de la table « notification_config ».
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:321)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122)
... 100 more
javax.faces.FacesException: #{listeEnvoiBean.suppListe()}: org.springframework.dao.DataIntegrityViolationException: ERREUR: UPDATE ou DELETE sur la table « liste_envoi » viole la contrainte de clé étrangère
« notifconfiglistefk » de la table « notification_config »
Détail : La clé (id)=(5) est toujours référencée à partir de la table « notification_config ».; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: ERREUR: UPDATE ou DELETE sur la table « liste_envoi » viole la contrainte de clé étrangère
« notifconfiglistefk » de la table « notification_config »
Détail : La clé (id)=(5) est toujours référencée à partir de la table « notification_config ».
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:89)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:654)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:64)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
最佳答案
按照 JPA 标准的要求,Hibernate 将 unschedule删除如果 PERSIST
操作应用于/级联到删除的实体。
确保从所有其他托管实体实例中删除对要删除的实体的所有引用。
可能会发生一些引用 Authorities
的实体。在删除不起作用的 session 中加载,但在删除按预期工作的 session 中未加载(因此 PERSIST
未级联)。
关于java - Hibernate 级联删除期间的 ConstraintViolationException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32432760/
我的服务中有一个方法: @Transactional public MyResponse create(UserCredentials cred) { User user =
mysql> alter table metakey add constraint Name unique(name); mysql> desc metakey; +-------+--------
我正在尝试使用 JPA 实体和 @SequenceGenerator 将一些数据添加到数据库中。但似乎这个生成器没有达到预期的效果,我不知道为什么。 Hibernate: call next valu
当我尝试使用 hibernate 进行 saveOrUpdate 时,出现 ConstraintViolationException。当我为用户插入一个全新的对象时,保存工作正常,但当我尝试更新时却失
我有 2 个对象实体(用户和电话),它们应该具有多对多关系。 User.java //all columns @ManyToMany(cascade = CascadeType.MERGE, fetc
这似乎应该是一个非常简单的问题,或者至少有一个简单的答案。但是 - 我真的不是数据库专家,而且我在 Hibernate 学习曲线上还差得很远。也就是说,这是设置: 考虑两个实体之间的单向多对多关系,从
我在 JEE 应用程序中有一些 SessionBean,并且喜欢使用 BeanValidation 来验证我的参数。因此整个验证过程是通用的并封装在一个地方。 我看到的唯一缺点是客户端得到一个 EJB
尽管我在日志中看到它,但我似乎无法捕捉到它。 实体 @Column(unique = true) private String email; 我正试图像这样捕获它 try { memb
我有一个具有多字段唯一约束的持久类。但是定义的唯一约束对我来说还不够,因为在一个字段上,那些不相等但相似的值也是唯一的。 我实现了一个 checkUniqueConstraint 方法。在 DAO 类
我正在使用 JSF+JPA 我没有修复这个错误: javax.validation.ConstraintViolationException: Bean Validation constraint(s
我正在编写一个 Spring 应用程序,似乎当我遇到数据库错误时,有时 Hibernate 的 ConstraintViolationException有时会抛出 Spring 的 DataInteg
如何获取导致org.hibernate.exception.ConstraintViolationException的字段名称?检查唯一约束的唯一可靠方法是事务提交,因此即使我在抛出异常之前检查它。因
我正在开发一个基于 Spring Boot 的 REST API。我正在使用自定义 ConstraintValidator 注释验证输入实体。我的问题是我无法在响应中返回 ConstraintViol
在 neo4j 2.0 中,如果您尝试对已经具有约束的索引施加约束,则会抛出 ConstraintViolationException,这是由 AlreadyConstrainedException
我正在尝试改进我在 spring MVC 应用程序中处理来自 DAO/服务层的异常的方式。我在下面使用的方法非常有效,不会导致 500 错误: Controller 代码 @RequestMappin
我有一个名为 add() 的服务方法,它用 @Transactional 注释。 我调用它,但是当在相应的 DAO 方法中发生 ConstraintViolationException 时,它会回滚事
我的数据库中有两个表:一个用于持久化用户,另一个用于保存他们的权限。 问题是,当我尝试删除用户时,必须删除权限,这样我才能避免收到违反约束的异常。我为此使用了 JPA 级联类型.ALL 和 orpha
我正在尝试将记录保存在具有多个唯一约束的表中。其中之一称为 UK_ESTABLISHMENT_REGISTERS_003,基于 2 列。 当用户尝试在表中输入重复值时,会引发约束冲突异常,但我无法检索
我正在使用 Play Framework,并具有以下代码: import org.hibernate.exception.ConstraintViolationException; ... publi
我正在努力解决这里的一个小问题。基本上我们有一个表,其中列不是 PK 但需要是唯一的,因此我们在其上添加了唯一性约束。现在,在我们的服务层中,我们希望捕获当有人创建打破该唯一性约束的记录时生成的异常,
我是一名优秀的程序员,十分优秀!