<?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>Team,  I have a database view already created. I am now trying to crea</title><link>https://community.appian.com/discussions/f/integrations/5696/team-i-have-a-database-view-already-created-i-am-now-trying-to-crea</link><description>Team, I have a database view already created. I am now trying to create a data type &amp;amp; data store in appian designer so that i can query the database using a!queryentity(). But it doesn&amp;#39;t allow me stating that a_id is missing as it is the primary key.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Team,&lt;br /&gt;&lt;br /&gt;I have a database view already created. I am now trying to crea</title><link>https://community.appian.com/thread/21662?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2015 21:47:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4a58b32f-ca4b-4ec6-84c9-f198611c621a</guid><dc:creator>senthilar</dc:creator><description>This is what we do to overcome this issue:&lt;br /&gt;1) Add rownum as a column in the view (eg CREATE VIEW &amp;lt;viewname&amp;gt; AS SELECT rownum ROW_ID, &amp;lt;other required columns&amp;gt;...)&lt;br /&gt;2) In XSD, use @Table annotation to point to this View and designate the ROW_ID column with @Id annotation&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Team,&lt;br /&gt;&lt;br /&gt;I have a database view already created. I am now trying to crea</title><link>https://community.appian.com/thread/21653?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2015 18:44:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:424261ab-23fa-4bfa-9129-196d439ace7e</guid><dc:creator>Jacob Cohen - Project Leader - Macedon Technologies</dc:creator><description>Here&amp;#39;s a link to some documentation on creating your XSD:&lt;br /&gt;&lt;a href="https://forum.appian.com/suite/help/7.10/Custom_Data_Types_from_XSD.html#-matching-a-cdt-to-an-existing-table-schema"&gt;forum.appian.com/.../Custom_Data_Types_from_XSD.html&lt;/a&gt;&lt;br /&gt;Check out the &amp;quot;&amp;lt;xsd:element name=&amp;quot;id&amp;quot; type=&amp;quot;xsd:int&amp;quot;&amp;gt;&amp;quot; tag for an example of a primary key definition.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Team,&lt;br /&gt;&lt;br /&gt;I have a database view already created. I am now trying to crea</title><link>https://community.appian.com/thread/21652?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2015 18:43:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a9bad98a-f48d-4191-9be2-6a6d7845a27c</guid><dc:creator>sikhivahans</dc:creator><description>@manikandang You need to do two things here:&lt;br /&gt;1. Provide the name of the database view to the 'name' attribute of @Table annotation.&lt;br /&gt;2. Provide the name of the column (which ever you feel is sufficient to uniquely identify a record) in your view to the 'name' attribute of the @Column annotation and designate this element with @Id annotation. &lt;br /&gt;&lt;br /&gt;Also please remember that there may not be a need to drop the view (Assuming that a working View is in place) because if the XSD doesn't map to the database entity it means that there is a problem with XSD, and we should try rectifying the problem in same.&lt;br /&gt;&lt;br /&gt;Here's an example of how you may do it:&lt;br /&gt;&lt;br /&gt;&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="test.com" targetNamespace="test.com"&gt;&lt;br /&gt;  &lt;xsd:complexType name="nameOfCdt"&gt;&lt;br /&gt;    &lt;xsd:annotation&gt;&lt;br /&gt;      &lt;xsd:appinfo source="appian.jpa"&gt;&lt;br /&gt;                @Table(name="nameOfDatabaseView")&lt;br /&gt;            &lt;/xsd:appinfo&gt;&lt;br /&gt;    &lt;/xsd:annotation&gt;&lt;br /&gt;    &lt;xsd:sequence&gt;&lt;br /&gt;      &lt;xsd:element name="nameOfUniqueIdColumnInCdt" type="xsd:int"&gt;&lt;br /&gt;        &lt;xsd:annotation&gt;&lt;br /&gt;          &lt;xsd:appinfo source="appian.jpa"&gt;@Id @Column(name="nameOfUniqueIdColumnInDatabaseView")&lt;/xsd:appinfo&gt;&lt;br /&gt;        &lt;/xsd:annotation&gt;&lt;br /&gt;      &lt;/xsd:element&gt;&lt;br /&gt;\                                        t&lt;--\tOther columns goes here\t--&gt;&lt;br /&gt;    &lt;/xsd:sequence&gt;&lt;br /&gt;  &lt;/xsd:complexType&gt;&lt;br /&gt;&lt;/xsd:schema&gt;&lt;br /&gt;&lt;br /&gt;And if you didn't make a search prior to posting, I would like to suggest to do so, as I remember there are some posts which resembles your query.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Team,&lt;br /&gt;&lt;br /&gt;I have a database view already created. I am now trying to crea</title><link>https://community.appian.com/thread/21647?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2015 17:34:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d5b96d82-56ef-4098-b8e0-907f16c4fff0</guid><dc:creator>neelimaj</dc:creator><description>Define a primary key to the cdt xsd file using @id  to define primary key.. If you do not define any primary key.. Appian automatically creates a primary key with name a_id.. Remove the previous table and publish the xsd again with primary key defined..&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>