StrataFrame Forum

BO with Guid (UniqueIdentifier) as Primary Key

http://forum.strataframe.net/Topic31829.aspx

By Chris Diesel - 2/14/2013

I originally had a table with an Integer Primary Key that was Auto Generated (Is Identity = true) on the server.  The business object property _PrimaryKeyFields contains the field "Id".

I added a new field Guid (UniqueIdentifier) to the table and changed the primary key to it instead of the Id field.  When I build the partial class with the Business Object Mapper, the _PrimaryKeyFields property does not contain any field names.

What am I doing wrong???
By StrataFrame Team - 2/14/2013

When you go into the BO mapper, does it show the key symbol for the list view icon for the row that marks the id field?

Are you mapping to SQL Server directly, or are you mapping to the DDT?
By Chris Diesel - 2/15/2013

SQL Management Studio shows the key symbol but the Business Object Mapper does not.  It shows the new field, just not as a key though.

I'm mapping directly to Sql.
By Chris Diesel - 2/15/2013

Found the problem. I had the same table name under a Test schema in the same database.  When I removed the primary key from it, the database object mapper picked up the primary key in the dbo schema.  Weird...
By StrataFrame Team - 2/15/2013

Hrm.  That is weird.  The BOMapper must have a schema off one of the meta-data queries.