﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Primary Key for Views</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 17:44:50 GMT</lastBuildDate><ttl>20</ttl><item><title>Primary Key for Views</title><link>http://forum.strataframe.net/FindPost3115.aspx</link><description>As previously mentioned on here, one of the improvements v1.5 brings is the ability to define a PK on a view. This allows&amp;nbsp;us to define a BO made up of multiple related tables, particularly the base-type/derived-type idiom, all within the database using SQL Server 'instead of' triggers on the view.&lt;/P&gt;&lt;P&gt;In essense, SF should treat such a view just like it was a normal table. But to get referential integrity support, SF needs to be able to assign the view a PK.&lt;/P&gt;&lt;P&gt;So now that I've just installed v1.5, I am apparently missing where in the DDT I would do that. It must be so obvious that I'm just looking in the wrong place...:)&lt;/P&gt;&lt;P&gt;Thanks!</description><pubDate>Wed, 04 Oct 2006 11:42:19 GMT</pubDate><dc:creator>Chris Crabtree</dc:creator></item><item><title>RE: Primary Key for Views</title><link>http://forum.strataframe.net/FindPost3291.aspx</link><description>I told you that I might be missing something:D Thanks for clarifying that for me.</description><pubDate>Wed, 04 Oct 2006 11:42:19 GMT</pubDate><dc:creator>Flavelle Ballem</dc:creator></item><item><title>RE: Primary Key for Views</title><link>http://forum.strataframe.net/FindPost3284.aspx</link><description>SQL Server 2005 will not let you define foreign keys from a view to other objects.&amp;nbsp; You can define indexes on a properly configured view, but not relationships and not primary keys, just regular indexes.&amp;nbsp; The PK definition within the BOMapper allows the BOMapper to specify the primary key when building the partial class for the business object.&amp;nbsp; This allows the business object to properly create the dynamic SQL at runtime that will be used to "insert" or "update" the view.&amp;nbsp; Without a primary key definition, an update from the BO to the database would fail because the WHERE clause of the update would not be able to specify only a single row.</description><pubDate>Wed, 04 Oct 2006 09:54:38 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Primary Key for Views</title><link>http://forum.strataframe.net/FindPost3272.aspx</link><description>Wouldn't referential integrity rules be required if the View was being used to insert or update values? I'm probably missing something.</description><pubDate>Wed, 04 Oct 2006 04:50:51 GMT</pubDate><dc:creator>Flavelle Ballem</dc:creator></item><item><title>RE: Primary Key for Views</title><link>http://forum.strataframe.net/FindPost3127.aspx</link><description>That is the nice thing about the framework.&amp;nbsp; You can define the relationships within the business objects themselves.&amp;nbsp; The relationships defined on the BOs do not have to actually exist on the server.</description><pubDate>Wed, 27 Sep 2006 13:18:58 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Primary Key for Views</title><link>http://forum.strataframe.net/FindPost3124.aspx</link><description>Okay...but if I can't define the view's PK in DDT, how do I define the relationships the view will have with the other tables, etc.?</description><pubDate>Wed, 27 Sep 2006 12:53:13 GMT</pubDate><dc:creator>Chris Crabtree</dc:creator></item><item><title>RE: Primary Key for Views</title><link>http://forum.strataframe.net/FindPost3121.aspx</link><description>Ah, the functionality was moved to the Business Object Mapper.&amp;nbsp; After you choose the view to which the business object gets its mapping information, you can go to the "advanced" options under the business object's properties and check the override primary key box, then click the "..." button and choose the fields that should be the primary key on the business object.</description><pubDate>Wed, 27 Sep 2006 12:30:45 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>