PrimaryKeyFields Property on a BO


Author
Message
Scott
Scott
StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
I have a BO that is based on a view.  The view has no column marked as the primary key so the BO mapper does not build the key into the designer file.  I am using this view to locate records using the BrowseDialog, becuase there is no primary key field, when the data is returned the BO currentrow is set to the first row in the datatable.  If I manually add the code to the designer file so that the BO knows what the key field of the view is, everything works fine.  Do you have an suggestions on how I can work with this situation?

Thanks

Scott

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You can add indexes to views, but not primary keys.  So, if you pull the view directly from SQL Server, the business object is not going to see the primary key.  The only way to get the BOMapper to see the primary key on a view is to use the Database Deployment Toolkit and create a table with the same structure as the view.  You can then define the primary key on the "faux" table and map your business object to it.  Then when you build the partial from the DDT information, you will be able to see the primary key.
Scott
Scott
StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
Thats kind of what I thought.  Thanks
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search