Hi,
I have to following error:
java.sql.SQLException: Integrity constraint violation FK_AO_AD8E0F_USER_MAIL_TEMPLATE_ENTITY_ID table: AO_AD8E0F_USER in statement [DELETE FROM PUBLIC.AO_AD8E0F_MAIL_TEMPLATE WHERE ID IN (?)]
at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.delete(EntityManagedActiveObjects.java:117)
at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.delete(DelegatingActiveObjects.java:66)
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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy1405.delete(Unknown Source)
at MyServiceImpl.deleteById(MailTemplateServiceImpl.java:102)
The error is suggesting that there's trouble with foreign key.Here's my models
@Preload
public interface MailTemplate extends Entity {
@OneToMany
public IssueRole[] getIssueRoles();
@OneToMany
public User[] getUsers();
}
@Preload
public interface IssueRole extends Entity {
public MailTemplate getMailTemplateEntity();
public void setMailTemplateEntity(MailTemplate mailTemplateEntity);
}
Any suggestion?
--------------------------------------------
UPDATE
@Preload
public interface User extends Entity {
@NotNull
public String getName();
public void setName(String name);
public MailTemplate getMailTemplate();
public void setMailTemplate(MailTemplate mailTemplate);
}