<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>An error occurred while trying to write to the entity “claims” [id=d150a3cb-49c3</title><link>https://community.appian.com/discussions/f/general/1169/an-error-occurred-while-trying-to-write-to-the-entity-claims-id-d150a3cb-49c3</link><description>An error occurred while trying to write to the entity “claims” [id=d150a3cb-49c3-44e2-9f46-792e400dc0d8@3966, type=ClaimsClaim (id=2024)] (data store: ClaimsProcess). Details: org.hibernate.id.IdentifierGenerationException: ids for this class must be</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: An error occurred while trying to write to the entity “claims” [id=d150a3cb-49c3</title><link>https://community.appian.com/thread/90840?ContentTypeID=1</link><pubDate>Wed, 09 Feb 2022 02:37:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c2492de3-2ec3-4b5f-ba88-6cfd9b6617fd</guid><dc:creator>girveriusm0002</dc:creator><description>&lt;p&gt;Thanks this help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An error occurred while trying to write to the entity “claims” [id=d150a3cb-49c3</title><link>https://community.appian.com/thread/85938?ContentTypeID=1</link><pubDate>Mon, 20 Sep 2021 20:49:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:afc193c1-12c8-4ca6-a7cb-406e4719ca0c</guid><dc:creator>Martin Gordon</dc:creator><description>&lt;p&gt;I got this same error. (&lt;span&gt;Details: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save())&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I had wanted to create my first Appian WEB API.&lt;/p&gt;
&lt;p&gt;I created a Data Store Entity without an autogenerated ID field.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I created a Service Account and got an API key, put the Service account into the viewer group and gave it access to my DSE, per the docs (&lt;a href="https://docs.appian.com/suite/help/21.3/Designing_Web_APIs.html"&gt;Creating Web APIs - Appian 21.3&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;My primary key(PK) field is unique, and called CNUMBER.&lt;/p&gt;
&lt;p&gt;I tried to use the first example example in the&lt;/p&gt;
&lt;pre&gt;&lt;span class="nf"&gt;a!writeToDataStoreEntity&lt;/span&gt;&lt;span class="ow"&gt;(&lt;/span&gt;
  &lt;span class="ss"&gt;dataStoreEntity:&lt;/span&gt; &lt;span class="no"&gt;cons!CES_POINTER_CHECKS_DATASTOREENTITY&lt;/span&gt;&lt;span class="ow"&gt;,&lt;/span&gt;
  &lt;span class="ss"&gt;valueToStore:&lt;/span&gt; &lt;span class="s"&gt;type!Employee&lt;/span&gt;&lt;span class="ow"&gt;(&lt;/span&gt;
    CNUMBER&lt;span class="ss"&gt;:&lt;/span&gt; &lt;span class="k"&gt;http!request.queryParameters.CNUMBER&lt;/span&gt;&lt;span class="ow"&gt;,&lt;/span&gt;
    CDATE&lt;span class="ss"&gt;:&lt;/span&gt; &lt;span class="k"&gt;http!request.queryParameters.CDATE&lt;/span&gt;&lt;span class="ow"&gt;,&lt;/span&gt;
    CAMOUNT&lt;span class="ss"&gt;:&lt;/span&gt; &lt;span class="k"&gt;http!request.queryParameters.CAMOUNT&lt;/span&gt;&lt;span class="ow"&gt;,&lt;/span&gt;
    CDESC&lt;span class="ss"&gt;:&lt;/span&gt; &lt;span class="k"&gt;http!request.queryParameters.CDESC&lt;/span&gt;
  &lt;span class="ow"&gt;),&lt;/span&gt;
  &lt;span class="ss"&gt;onSuccess:&lt;/span&gt; &lt;span class="nf"&gt;a!httpResponse&lt;/span&gt;&lt;span class="ow"&gt;(&lt;/span&gt;
    &lt;span class="ss"&gt;statusCode:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="ow"&gt;,&lt;/span&gt;
    &lt;span class="ss"&gt;headers:&lt;/span&gt; &lt;span class="ow"&gt;{&lt;/span&gt;
      &lt;span class="nf"&gt;a!httpHeader&lt;/span&gt;&lt;span class="ow"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;name:&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;Content-Type&amp;quot;&lt;/span&gt;&lt;span class="ow"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;value:&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;application/json&amp;quot;&lt;/span&gt;&lt;span class="ow"&gt;)&lt;/span&gt;
    &lt;span class="ow"&gt;},&lt;/span&gt;
    &lt;span class="ss"&gt;body:&lt;/span&gt; &lt;span class="nf"&gt;a!toJson&lt;/span&gt;&lt;span class="ow"&gt;(&lt;/span&gt;
      &lt;span class="k"&gt;fv!storedValues&lt;/span&gt;
    &lt;span class="ow"&gt;)&lt;/span&gt;
  &lt;span class="ow"&gt;),&lt;/span&gt;
  &lt;span class="ss"&gt;onError:&lt;/span&gt; &lt;span class="nf"&gt;a!httpResponse&lt;/span&gt;&lt;span class="ow"&gt;(&lt;/span&gt;
    &lt;span class="ss"&gt;statusCode:&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="ow"&gt;,&lt;/span&gt;
    &lt;span class="ss"&gt;headers:&lt;/span&gt; &lt;span class="ow"&gt;{&lt;/span&gt;
      &lt;span class="nf"&gt;a!httpHeader&lt;/span&gt;&lt;span class="ow"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;name:&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;Content-Type&amp;quot;&lt;/span&gt;&lt;span class="ow"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;value:&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;application/json&amp;quot;&lt;/span&gt;&lt;span class="ow"&gt;)&lt;/span&gt;
    &lt;span class="ow"&gt;},&lt;/span&gt;
    &lt;span class="ss"&gt;body:&lt;/span&gt; &lt;span class="nf"&gt;a!toJson&lt;/span&gt;&lt;span class="ow"&gt;(&lt;/span&gt;
      &lt;span class="ow"&gt;{&lt;/span&gt;
        &lt;span class="ss"&gt;error:&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;There was an error writing to the data store&amp;quot;&lt;/span&gt;
      &lt;span class="ow"&gt;}&lt;/span&gt;
    &lt;span class="ow"&gt;)&lt;/span&gt;
  &lt;span class="ow"&gt;)&lt;/span&gt;
&lt;span class="ow"&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I tested it in the WEB API node it worked perfectly and added or updated a record in my table.&lt;/p&gt;
&lt;p&gt;When I tried to access remotely, I got the error.&lt;/p&gt;
&lt;p&gt;I tried adding an auto generated id field, then the WEB API node failed and I still got the error. I would up fixing this by using the Web API Tutorial Level II example:&amp;nbsp;&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/21.3/Web_API_Tutorial_-_Level_II.html"&gt;Web API Tutorial - Level II - Appian 21.3&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So the working code is:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;a!localVariables(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt; &amp;nbsp; &amp;nbsp;local!value: cast(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp;&amp;#39;type!{urn:com:appian:types}CES_CHECKS&amp;#39;,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; a!fromJson(http!request.body)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; ),&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; a!writeToDataStoreEntity(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dataStoreEntity: cons!CES_POINTER_CHECKS_DATASTOREENTITY,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; valueToStore: local!value,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; onSuccess: a!httpResponse(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; statusCode: 200,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; headers: {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a!httpHeader(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name: &amp;quot;Content-Type&amp;quot;,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; value: &amp;quot;application/json&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; },&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;body: a!toJson(fv!storedValues)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; ),&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; onError: a!httpResponse(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; statusCode: 500,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; headers: {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; a!httpHeader(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; name: &amp;quot;Content-Type&amp;quot;,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp;value: &amp;quot;application/json&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp;)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; },&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; body: a!toJson(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp; error: &amp;quot;There was another error writing to the data store&amp;quot;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; &amp;nbsp;)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp; )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;&amp;nbsp;)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Which works great when called from UBUNTU curl as follows:&lt;/p&gt;
&lt;p&gt;curl &lt;a href="https://myenv.appian.community/suite/webapi/myenv_cendpoint"&gt;myenv.appian.community/.../myenv_cendpoint&lt;/a&gt; -H &amp;quot;Appian-API-Key:MySecretApiKeykjldsjfksjflsjdfsjldsjfkldjslfj&amp;quot; -H &amp;quot;Content-Type:application/json&amp;quot; --request POST --data &amp;#39;{&amp;quot;CNUMBER&amp;quot;:12,&amp;quot;CDATE&amp;quot;:&amp;quot;20210920&amp;quot;,&amp;quot;CAMOUNT&amp;quot;:2123.44,&amp;quot;CDESC&amp;quot;:&amp;quot;a desc&amp;quot;}&amp;#39;&lt;/p&gt;
&lt;p&gt;This was a pain to hack out.&amp;nbsp; Hope this helps someone!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An error occurred while trying to write to the entity “claims” [id=d150a3cb-49c3</title><link>https://community.appian.com/thread/74831?ContentTypeID=1</link><pubDate>Thu, 18 Jun 2020 14:37:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b33393e7-502c-40f5-9a06-e3ab982bf36b</guid><dc:creator>Atharva</dc:creator><description>&lt;p&gt;Thank you ! It helped me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An error occurred while trying to write to the entity “claims” [id=d150a3cb-49c3</title><link>https://community.appian.com/thread/71534?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2020 22:26:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e40d8adf-c176-4076-b318-c55df0e9a881</guid><dc:creator>James Havenga</dc:creator><description>&lt;p&gt;The comment from&amp;nbsp;&lt;a href="/members/sayalip"&gt;sayalip&lt;/a&gt;&amp;nbsp;helped me in my case. For some reason the &amp;quot;@GeneratedValue&amp;quot; wasn&amp;#39;t added to the primary key field in the XSD by Appian, so I added this manually and the error was resolved.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An error occurred while trying to write to the entity “claims” [id=d150a3cb-49c3</title><link>https://community.appian.com/thread/55414?ContentTypeID=1</link><pubDate>Mon, 21 May 2018 16:02:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:df34ddc7-3c55-4b4b-825f-18e6a8a3f916</guid><dc:creator>sayalip</dc:creator><description>Hi,&lt;br /&gt;
&lt;br /&gt;
Please download your XSD and add JPA annotations appropriate to your requirement (add @GeneratedValue for your ID field), save it and then create a new version of the CDT from XSD. You will need to verify and publish your Data Store again in order to reflect these changes.&lt;br /&gt;
&lt;br /&gt;
Hope it helps!!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An error occurred while trying to write to the entity “claims” [id=d150a3cb-49c3</title><link>https://community.appian.com/thread/55227?ContentTypeID=1</link><pubDate>Wed, 16 May 2018 13:43:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fb174932-191f-4800-a5b7-928401841f8c</guid><dc:creator>Smruti Swain</dc:creator><description>Please check the primary key in the CDT and see if the auto-generate option is selected, else you will have to pass a value to the PK before writing records to a data store entity.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An error occurred while trying to write to the entity “claims” [id=d150a3cb-49c3</title><link>https://community.appian.com/thread/55164?ContentTypeID=1</link><pubDate>Tue, 15 May 2018 11:07:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:84164eb2-6a75-4b0a-b21a-109013e4e1e3</guid><dc:creator>ravalik</dc:creator><description>Hi rahulk,&lt;br /&gt;
&lt;br /&gt;
Could u please share your XSD if possible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
ravalik&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An error occurred while trying to write to the entity “claims” [id=d150a3cb-49c3</title><link>https://community.appian.com/thread/55161?ContentTypeID=1</link><pubDate>Tue, 15 May 2018 10:57:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8be5e43f-1ed5-4b50-9185-0ce99fb32236</guid><dc:creator>Thenmozhi Mohanakrishnan</dc:creator><description>We are also facing this issue.. Any update?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An error occurred while trying to write to the entity “claims” [id=d150a3cb-49c3</title><link>https://community.appian.com/thread/22373?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2015 16:37:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:66345e22-3035-4e69-9fb3-396c4c37bbe4</guid><dc:creator>Durgesh</dc:creator><description>Hi,&lt;br /&gt;I did face same issue while inserting the data in a table. Did you get remedy for this issue?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An error occurred while trying to write to the entity “claims” [id=d150a3cb-49c3</title><link>https://community.appian.com/thread/4016?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2013 10:56:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:020ccf5e-a3b0-47cb-b8e9-de21c07a0a3c</guid><dc:creator>rahulk828</dc:creator><description>Hi,&lt;br /&gt;&lt;br /&gt;We are providing all the primary keys through the process. Still its giving this error.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>