BaseIntegerIdEntity and zero value

HI,

i used @AttributeOverrides to override the default name Id of a BaseIntegerEntityId.

everything works fine, the only problem I encountered is that if the integer key is zero value, when it becomes foreign key of another table i have an exception:

IllegalStateException: During synchronization a new object was found through a relationship That was not marked cascade PERSIST: it.poloristorazione.erp.entity.Tgn27-0 [detached]. <i></i>

This error does not occur with the same table with non-zero values.

If is not possibile to solve this problem, i can update with another value, all the tables in the database with zero value as key …

Thank you.

Maurizio.

Hi Maurizio,

Perhaps these records with 0 value primary keys were created by a legacy application, and it’s better to update them if possible. CUBA app should start numbering of BaseIntegerEntityId from 1.

Ok Konstantin,

it’s not a problem, i proceed to update all the keys with value 0, with another value.

Thank you.

Maurizio.