I have this case: in entity I set a sequence with @GeneratedValue and @SequenceGenerator.
I use a Db where it is set for each ID(primary key) to have auto increment with special sequense. This is the reason to use this annotation to connect corrently the sequense.
When I try to insert a new record, the jmix displays this error (entityId is null) but the data is inserted in db.
I try to fix it with your @JmixGeneratedValue(sequenceName = “sequence_name”),
but it genarates a new Id always when I open the screen for inserting, no matter if I save the data in db or not.
I want to generate a new ID only when i have a record in db.
thank you an advance
I have this case: in entity I set a sequence with @GeneratedValue and @SequenceGenerator.
I use a Db where it is set for each ID(primary key) to have auto increment with special sequense. This is the reason to use this annotation to connect corrently the sequense.
When I try to insert a new record, the jmix displays this error (entityId is null) but the data is inserted in db.
I try to fix it with your @JmixGeneratedValue(sequenceName = “sequence_name”),
but it genarates a new Id always when I open the screen for inserting, no matter if I save the data in db or not.
I want to generate a new ID only when i have a record in db.
Unfortunately, we cannot reproduce the problem. We will be able to help you if you send us a small sample project along with step by step scenario of actions taken prior to getting an error.
Also,in case you will encounter any other problems in the future - it would help us a lot if you could share with us the following data:
your environment specifications (OS/IDEA versions and any additional libraries used)
in Document Entity i set the sequence with @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = “DOCUMENTS_ID_SEQ”) @SequenceGenerator(name = “DOCUMENTS_ID_SEQ”, sequenceName = “DOCUMENTS_ID_SEQ”, allocationSize = 1)
When I save a new record I received: EntityId is null
In CorrespondenceType Entity : I set the sequence with @JmixGeneratedValue(sequenceName = “CORRESPONDENCE_TYPE_ID_SEQ”)
Always when I open the screen for inserting, the Id field has a new value(+1) no matter if I save the data in db or not.
I want to generate a new ID only when i have a record in db.
Good day. I have a similar problem
There are two entities: Contractor and license. license is a composite attribute (one2many) of the Contractor entity. Entities have an id of type long with filling using sequence. I tried auto-increment, same thing).
I add a license on the Contractor entry form and an error occurs. openMode=“DIALOG”.
It works normally only when the field IDs have the @JmixGeneratedValut annotation; in all other entities an error occurs.
Lombok is not used.