<?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>nested Data types. Cascade Type</title><link>https://community.appian.com/discussions/f/general/17926/nested-data-types-cascade-type</link><description>I have CDT with several nested data types. is there any way to avoid updating a nested entity in DB? because I should update some nested data types</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: nested Data types. Cascade Type</title><link>https://community.appian.com/thread/70580?ContentTypeID=1</link><pubDate>Wed, 20 Nov 2019 07:56:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1f36527d-eda6-4110-babf-80748199018a</guid><dc:creator>dariab0002</dc:creator><description>&lt;p&gt;Sure. We have main CDT which refers to some other data types. For example one of them:&lt;/p&gt;
&lt;p&gt;-Transfer (main cdt)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; - beneficiary (nested cdt)&amp;nbsp; - @ManyToOne(cascade=CascadeType.ALL)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - bank&amp;nbsp;&lt;span&gt;(nested cdt) -&amp;nbsp;@ManyToOne(cascade=CascadeType.REFRESH)&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We need to update a beneficiary when Transfer is updated, but we should not update Bank (it&amp;#39;s dictionary). There are a lot of errors when Appian tries to update Bank&amp;nbsp;in logs.&amp;nbsp; The error reason&amp;nbsp;is a deadlock for the Bank table.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nested Data types. Cascade Type</title><link>https://community.appian.com/thread/70576?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 22:14:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aa2a7558-8a17-4d8b-aa54-75707313c6c1</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;What kind of relationship are you using? Can you describe a bit more about your use case?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nested Data types. Cascade Type</title><link>https://community.appian.com/thread/70563?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 15:16:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ed47c718-f893-4255-b6b1-90d085917b41</guid><dc:creator>dariab0002</dc:creator><description>&lt;p&gt;thank you for your answer, but look like REFRESH update child too. We got it from logs. We have nested data type - bank/ And every time when we update parent entity - bank entity is updated too...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nested Data types. Cascade Type</title><link>https://community.appian.com/thread/70562?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 14:55:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d79c0f6a-34b5-4d2b-ad86-4bd0ee4231ef</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;There&amp;#39;s a lot of good information on the &lt;a href="https://docs.appian.com/suite/help/latest/CDT_Relationships.html"&gt;CDT Relationships&lt;/a&gt; page in the docs. In your case, the main section to look at is the section on Cascade. The Cascade type determines whether or not to update child data in nested CDTs when you write to a Data Store Entity.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you use CASCADE=ALL, it will update all data for the parent and child CDTs.&lt;/li&gt;
&lt;li&gt;If you use CASCADE=REFRESH, it will only update the parent CDT. Based on your question, this seems like what you might want.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For both of these options, you can change the cascade type by clicking on the foreign key icon in the CDT designer. If you want to make this change to a CDT that is already mapped to the database, you will also need to alter your existing tables to use this new cascade type.&lt;/p&gt;
&lt;p&gt;In general, One-to-One and One-to-Many work well with the CASCADE=ALL (this is also often called Master-Detail). Many-to-One and Many-to-Many usually work better with CASCADE=REFRESH (also called reference behavior).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>