Hello,
In the Activiti documentation under JPA Requirements there is a bullet point which reads:
... compound primary keys are not supported (
@EmbeddedId
and@IdClass
).
Could someone please elaborate on why compound primary keys are not supported, and what sort of errors could be expected?
Thanks!
Sean
Hi Sean,
If you try to use compound primary key @EmbeddedId
and @IdClass
you will get the following error:
Caused by: org.hibernate.MappingException: Composite-id class must implement Serializable: org.activiti.ApplicantID
Have you tried using composite id and see this error?
I used this github repo GitHub - jbarrez/spring-boot-with-activiti-example to run a unit test with a composite Ids with @IdClass.
I guess this is a design decision that needs to be made for JPA to work with Activiti process variables. Will need more inspection to source code to understand why.
Having said that, is this a blocker for you? Would be interesting to understand your scenario and whether we could find a workaround.
Looking forward to hear back from you,
Thanks,
Thong Huynh
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.