Extending an entity with an integral ID using the JOINED strategy twice causes PK violations

Hello again!

Let’s say I have a Person entity which extends BaseLongIdEntity and uses the JOINED inheritance strategy. If I create two entities which extend Person, say Employee and Student, and then try to use a generic edit screen to create one instance of each of the derived entities, I get a Primary Key violation when trying to insert the second one in the database. (Demo project attached which illustrates the problem - try creating an Employee and then a Student instance - exception is thrown on the latter as it tries to insert into DEMO_PERSON using ID = 1.)

It seems CUBA is generating IDs based on the derived class type, ignoring the fact that the PK is actually controlled by the superclass.

This is obviously a major concern. Any idea how I can get around this?

Kind regards,

David

Demo.zip (132.4K)

Hi David,

Thank you for reporting the issue.

It’s really a serious problem, we’ll try to fix it ASAP.

Hello, again.

I see from the YouTrack issue that this has now been fixed in 6.4.2. Do you have any idea when 6.4.2 will be released? This is obviously a pretty critical issue for us.

Kind regards,

David

Hi David,

It should be available tomorrow.

Fantastic, thanks for the quick work.

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/PL-8699