Error In Process Model

Hi All ,

can you guys help me to fix this error .

An error occurred while trying to write to the entity “testTableR” [id=29e7a83e-f6e0-4bd6-a17f-5cc8c25ca65f@384909, type=testTableR (id=21820)] (data store: Testing). Details: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): TestTableRDT23845 Data: TypedValue[it=21821,v={{<null>,test,8765,2020-02-19,636465.0,23}}]

  Discussion posts and replies are publicly visible

  • 0
    Certified Senior Developer

    Please download the XSD and check if "@GeneratedValue" annotation is added for the id field(Primary Key).

  • <xsd:schema xmlns:xsd="">www.w3.org/.../XMLSchema" xmlns:tns="urn:com:appian:types" targetNamespace="urn:com:appian:types">
    <xsd:complexType name="testTableR">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Table(name="testTable")</xsd:appinfo>
    <xsd:documentation><![CDATA[testing]]></xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
    <xsd:element name="id" nillable="true" type="xsd:int">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Id @Column(name="id", nullable=false, unique=true, columnDefinition="INT")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="name" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="name", columnDefinition="NVARCHAR(50)")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="phno" nillable="true" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="phNo", columnDefinition="NVARCHAR(100)")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="dob" nillable="true" type="xsd:date">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="DOB", columnDefinition="DATE")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="salary" nillable="true" type="xsd:double">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="Salary", columnDefinition="FLOAT")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="age" nillable="true" type="xsd:int">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="age", columnDefinition="INT")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>

  • 0
    Certified Senior Developer
    in reply to danb0002

    <xsd:element name="id" nillable="true" type="xsd:int">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Id @GeneratedValue @Column(name="id", nullable=false, unique=true, columnDefinition="INT")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>

  • An error occurred while trying to write to the entity “testTableR” [id=29e7a83e-f6e0-4bd6-a17f-5cc8c25ca65f@384909, type=testTableR (id=21838)] (data store: Testing). Details: org.hibernate.exception.ConstraintViolationException: could not insert: [TestTableRDT23851]: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert the value NULL into column 'id', table 'Appian.dbo.testTable'; column does not allow nulls. INSERT fails. Data: TypedValue[it=21839,v={{<null>,test,8765,2020-02-20,1122111.0,21}}]

  • 0
    Certified Senior Developer
    in reply to danb0002

    Please publish the datastore after creating new version of XSD and re-map the required variables.

  • It's not enough to re-publish the data store. You will also have to update the database directly. You can either (1) add the auto-increment property to your existing table or (2) drop and recreate the table. Assuming you don't have much in the table already, I'd suggest just dropping the table. Then, if you republish your data store, it will recreate the table with the correct structure.