This is a migrated thread and some comments may be shown as answers.

Default Data for Forward Mapping

2 Answers 52 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 28 Mar 2010, 05:58 PM
I'm starting my first forward mapping project...

Whats the recommended way to insert Default Values for certain tables?  For example I have a list of Hospitals, that I want to insert if they don't exist....(or on DB creation)

Thanks,
Steve

2 Answers, 1 is accepted

Sort by
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 28 Mar 2010, 08:05 PM
Sorry, also

Is there a setting somewhere to blow away the OA Schema and have it re-load everything?

Lets say I have a table named "person" and I want to rename it to "people"...OA keeps "person" around and makes a new table called "people".


0
Serge
Telerik team
answered on 30 Mar 2010, 01:12 PM
Hi Steve,

Telerik OpenAccess ORM does not have a mechanism for persisting default values in tables. You will have to insert them manually. Additionally, if you are not going to add other records to that table you can change the class behavior to readonly using the forward mapping wizard to make sure the records are not deleted accidentally.

When you change the name of a table OpenAccess creates a new table with the new name. There is no way for the migration tool to know that a table or field is renamed instead of a new one being added. Your options are to either follow this article to get the SQL script with the database changes and modify it accordingly or just manually rename the table before building your solution. Also, currently there is no functionality that can be used to drop the database. You will have to do this manually. Hope that helps.

Regards,
Serge
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Getting Started
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Serge
Telerik team
Share this question
or