Default Data for Forward Mapping

Thread is closed for posting
3 posts, 0 answers
  1. Steve
    Steve avatar
    1886 posts
    Member since:
    Dec 2008

    Posted 28 Mar 2010 Link to this post

    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)

  2. Steve
    Steve avatar
    1886 posts
    Member since:
    Dec 2008

    Posted 28 Mar 2010 Link to this post

    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".

  3. Serge
    Serge avatar
    375 posts

    Posted 30 Mar 2010 Link to this post

    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.

    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.
Back to Top