<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: LightSpeed Identity Generation</title> <atom:link href="http://www.mindscape.co.nz/blog/index.php/2007/08/26/lightspeed-identity-generation/feed/" rel="self" type="application/rss+xml" /><link>http://www.mindscape.co.nz/blog/index.php/2007/08/26/lightspeed-identity-generation/</link> <description>The official blog of Mindscape</description> <lastBuildDate>Thu, 09 Sep 2010 22:49:44 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>By: Gerard van de Ven</title><link>http://www.mindscape.co.nz/blog/index.php/2007/08/26/lightspeed-identity-generation/comment-page-1/#comment-37439</link> <dc:creator>Gerard van de Ven</dc:creator> <pubDate>Tue, 02 Feb 2010 01:13:15 +0000</pubDate> <guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=52#comment-37439</guid> <description>I ran into a different scenario today, where I would like one of my tables to have a Guid ID(because other apps also insert values in this table) but would like to keep the rest on KeyTable for efficiency.
That did not work of course and I was reminded that the context requires one single Identity generation method.
Would it be an idea to have a table override the context wide ID generation method (I can see that that would not make ID generation and object insertion easier, but hey, it would be a great challenge for you guys to get it working :-) ).</description> <content:encoded><![CDATA[<p>I ran into a different scenario today, where I would like one of my tables to have a Guid ID(because other apps also insert values in this table) but would like to keep the rest on KeyTable for efficiency.<br
/> That did not work of course and I was reminded that the context requires one single Identity generation method.<br
/> Would it be an idea to have a table override the context wide ID generation method (I can see that that would not make ID generation and object insertion easier, but hey, it would be a great challenge for you guys to get it working :-) ).</p> ]]></content:encoded> </item> <item><title>By: Bart McLeod</title><link>http://www.mindscape.co.nz/blog/index.php/2007/08/26/lightspeed-identity-generation/comment-page-1/#comment-33159</link> <dc:creator>Bart McLeod</dc:creator> <pubDate>Wed, 01 Jul 2009 08:34:57 +0000</pubDate> <guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=52#comment-33159</guid> <description>I had no success with overriding GenerateId().So I will move this topic to the forum and see if we can work it out there.</description> <content:encoded><![CDATA[<p>I had no success with overriding GenerateId().</p><p>So I will move this topic to the forum and see if we can work it out there.</p> ]]></content:encoded> </item> <item><title>By: John-Daniel Trask</title><link>http://www.mindscape.co.nz/blog/index.php/2007/08/26/lightspeed-identity-generation/comment-page-1/#comment-33144</link> <dc:creator>John-Daniel Trask</dc:creator> <pubDate>Tue, 30 Jun 2009 08:48:19 +0000</pubDate> <guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=52#comment-33144</guid> <description>Thanks for the feedback Bart :-)There isn&#039;t a screencast about identity generation however we are planning to release a bunch more casts around the LightSpeed 3.0 launch so I&#039;ll make a note that you&#039;re interested in one regarding entity generation and try to get one made.I hope that helps.</description> <content:encoded><![CDATA[<p>Thanks for the feedback Bart :-)</p><p>There isn&#8217;t a screencast about identity generation however we are planning to release a bunch more casts around the LightSpeed 3.0 launch so I&#8217;ll make a note that you&#8217;re interested in one regarding entity generation and try to get one made.</p><p>I hope that helps.</p> ]]></content:encoded> </item> <item><title>By: Bart McLeod</title><link>http://www.mindscape.co.nz/blog/index.php/2007/08/26/lightspeed-identity-generation/comment-page-1/#comment-33143</link> <dc:creator>Bart McLeod</dc:creator> <pubDate>Tue, 30 Jun 2009 08:37:10 +0000</pubDate> <guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=52#comment-33143</guid> <description>I must say you guys are really fast at answering these questions.For others to know: we bought a LightSpeed license (professional version) and we are very satisfied in general).I will try your recommendations, because I like the idea of overriding the GenerateID() method instead of cripling the datamodel to accommodate for autoincrementing keys.If I encounter any problems I will let you know. Is there an example or a screencast of an override of this function?</description> <content:encoded><![CDATA[<p>I must say you guys are really fast at answering these questions.</p><p>For others to know: we bought a LightSpeed license (professional version) and we are very satisfied in general).</p><p>I will try your recommendations, because I like the idea of overriding the GenerateID() method instead of cripling the datamodel to accommodate for autoincrementing keys.</p><p>If I encounter any problems I will let you know. Is there an example or a screencast of an override of this function?</p> ]]></content:encoded> </item> <item><title>By: Ivan Towlson</title><link>http://www.mindscape.co.nz/blog/index.php/2007/08/26/lightspeed-identity-generation/comment-page-1/#comment-33136</link> <dc:creator>Ivan Towlson</dc:creator> <pubDate>Mon, 29 Jun 2009 23:40:56 +0000</pubDate> <guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=52#comment-33136</guid> <description>Oh, and regarding overriding GeneratedId again when you regenerate the model, you would implement GeneratedId in a partial class, so it won&#039;t be overwritten when you regenerate the model.  Of course if the set of keys changes (effectively, the identity type changes) then you would need to update the implementation to reflect this.</description> <content:encoded><![CDATA[<p>Oh, and regarding overriding GeneratedId again when you regenerate the model, you would implement GeneratedId in a partial class, so it won&#8217;t be overwritten when you regenerate the model.  Of course if the set of keys changes (effectively, the identity type changes) then you would need to update the implementation to reflect this.</p> ]]></content:encoded> </item> <item><title>By: Ivan Towlson</title><link>http://www.mindscape.co.nz/blog/index.php/2007/08/26/lightspeed-identity-generation/comment-page-1/#comment-33135</link> <dc:creator>Ivan Towlson</dc:creator> <pubDate>Mon, 29 Jun 2009 23:39:13 +0000</pubDate> <guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=52#comment-33135</guid> <description>You can&#039;t &quot;let it do nothing&quot; -- GeneratedId() must return a value (and it must be suitable for use as a unique key).  Put another way, every entity must have an identity, whether that identity is generated by the database (e.g. IdentityColumn), by LightSpeed (e.g. Guid) or by the entity itself (GeneratedId override).  But yes, if you override GeneratedId() then LightSpeed will not attempt to generate its own keys: it will use yours instead.Note that the identity is always represented by the Id property.  This will still be the case in the composite key scenario.  So in your example, setting .ProjectId and .PersonId is *not* setting the identity.  What we&#039;re envisaging is that a composite key is represented by a record type e.g. PersonProject might inherit from Entity&lt;PersonProjectId&gt;, so its Id property is of type PersonProjectId, where PersonProjectId has the PersonId and ProjectId fields.  The problem is therefore how to generate PersonProjectId instances to identity new entities, and at the moment we haven&#039;t got a better answer than &quot;override GeneratedId() to return a PersonProjectId&quot; (instead of, say, an int or a GUID).  But it&#039;s early days yet!</description> <content:encoded><![CDATA[<p>You can&#8217;t &#8220;let it do nothing&#8221; &#8212; GeneratedId() must return a value (and it must be suitable for use as a unique key).  Put another way, every entity must have an identity, whether that identity is generated by the database (e.g. IdentityColumn), by LightSpeed (e.g. Guid) or by the entity itself (GeneratedId override).  But yes, if you override GeneratedId() then LightSpeed will not attempt to generate its own keys: it will use yours instead.</p><p>Note that the identity is always represented by the Id property.  This will still be the case in the composite key scenario.  So in your example, setting .ProjectId and .PersonId is *not* setting the identity.  What we&#8217;re envisaging is that a composite key is represented by a record type e.g. PersonProject might inherit from Entity <personprojectid>, so its Id property is of type PersonProjectId, where PersonProjectId has the PersonId and ProjectId fields.  The problem is therefore how to generate PersonProjectId instances to identity new entities, and at the moment we haven&#8217;t got a better answer than &#8220;override GeneratedId() to return a PersonProjectId&#8221; (instead of, say, an int or a GUID).  But it&#8217;s early days yet!</personprojectid> ]]></content:encoded> </item> <item><title>By: Bart McLeod</title><link>http://www.mindscape.co.nz/blog/index.php/2007/08/26/lightspeed-identity-generation/comment-page-1/#comment-33133</link> <dc:creator>Bart McLeod</dc:creator> <pubDate>Mon, 29 Jun 2009 21:27:33 +0000</pubDate> <guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=52#comment-33133</guid> <description>Good that your are planning for it!If I understand it right, our problems are solved if we override GeneratedId() and let it do nothing? But we will then have to override it again if we regenerate the model?</description> <content:encoded><![CDATA[<p>Good that your are planning for it!</p><p>If I understand it right, our problems are solved if we override GeneratedId() and let it do nothing? But we will then have to override it again if we regenerate the model?</p> ]]></content:encoded> </item> <item><title>By: Ivan Towlson</title><link>http://www.mindscape.co.nz/blog/index.php/2007/08/26/lightspeed-identity-generation/comment-page-1/#comment-33132</link> <dc:creator>Ivan Towlson</dc:creator> <pubDate>Mon, 29 Jun 2009 21:15:13 +0000</pubDate> <guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=52#comment-33132</guid> <description>We&#039;ve been looking at composite key support for LightSpeed 3, and one of the issues is indeed how to handle key generation.  At present this requires the entity to override GeneratedId() (which bypasses the IdentityMethod and therefore effectively turns off key generation), but we&#039;re hoping to come up with an externalised strategy for this if time permits.</description> <content:encoded><![CDATA[<p>We&#8217;ve been looking at composite key support for LightSpeed 3, and one of the issues is indeed how to handle key generation.  At present this requires the entity to override GeneratedId() (which bypasses the IdentityMethod and therefore effectively turns off key generation), but we&#8217;re hoping to come up with an externalised strategy for this if time permits.</p> ]]></content:encoded> </item> <item><title>By: Bart McLeod</title><link>http://www.mindscape.co.nz/blog/index.php/2007/08/26/lightspeed-identity-generation/comment-page-1/#comment-33129</link> <dc:creator>Bart McLeod</dc:creator> <pubDate>Mon, 29 Jun 2009 11:54:40 +0000</pubDate> <guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=52#comment-33129</guid> <description>How about compound keys?ProjectId //primary
PersonId //primaryIn this case, the application will create the key by setting:personProject.projectId = ProjectID;
personProject.personId = PersonID;and thus key generation should be turned off.But... it does not seem to be possible to turn if off.Could &#039;off&#039; be added as a &#039;feature&#039;?-Bart</description> <content:encoded><![CDATA[<p>How about compound keys?</p><p>ProjectId //primary<br
/> PersonId //primary</p><p>In this case, the application will create the key by setting:</p><p>personProject.projectId = ProjectID;<br
/> personProject.personId = PersonID;</p><p>and thus key generation should be turned off.</p><p>But&#8230; it does not seem to be possible to turn if off.</p><p>Could &#8216;off&#8217; be added as a &#8216;feature&#8217;?</p><p>-Bart</p> ]]></content:encoded> </item> <item><title>By: Mindscape - MindBlog</title><link>http://www.mindscape.co.nz/blog/index.php/2007/08/26/lightspeed-identity-generation/comment-page-1/#comment-5402</link> <dc:creator>Mindscape - MindBlog</dc:creator> <pubDate>Tue, 27 Nov 2007 01:06:53 +0000</pubDate> <guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=52#comment-5402</guid> <description>[...] Previously LightSpeed only supported auto-incrementing identities for SQL Server however we&#8217;ve extended this functionality to PostgreSQL, MySQL and SQLite for developers working with those databases. We still suggest that developers should use other identity generation methods as highlighted in this earlier post about how LightSpeed handles identity generation. [...]</description> <content:encoded><![CDATA[<p>[...] Previously LightSpeed only supported auto-incrementing identities for SQL Server however we&#8217;ve extended this functionality to PostgreSQL, MySQL and SQLite for developers working with those databases. We still suggest that developers should use other identity generation methods as highlighted in this earlier post about how LightSpeed handles identity generation. [...]</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (request URI is rejected)

Served from: www.mindscape.co.nz @ 2010-09-10 06:56:29 -->