The system is trying to convert String to Integer and the field is String
Create a new record where the primary key is a String save then try to edit and change the value of the primary key and save again. The system will not update the record, it will create a new one, why is this happening? if I cannot edit the value of a primary key of type String, why does the system let me edit this field when I click edit?
Create a new record where the primary key is a String save then try to edit and change the value of the primary key and save again. The system will not update the record, it will create a new one, why is this happening?
It is normal behavior that when the identifier is changed, a new record is created. JPA ORM doesn’t take into account PK changes.
if I cannot edit the value of a primary key of type String, why does the system let me edit this field when I click edit?
When creating a string entity, you must specify an identifier. The platform will not be able to generate it automatically for the String data type, so the screen contains an editable ID field. You can always prevent field editing for existing entities in the screen controller.
The system is trying to convert String to Integer and the field is String
Could you provide a sample project that reproduces the problem?
Hi,
The problem relates to the view Cep_View with the ID integer column.
ID column is calculated as: isnull(cast(ltrim(rtrim(upper(a.cep))) as int),0).
MSSQL can’t cast 01001000-XXX string value to integer value and throws an error:
Conversion failed when converting the varchar value ‘01001000-XXX’ to data type int.