Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

How to import model from a database
xomega
#1 Posted : Friday, July 1, 2011 4:54:55 PM(UTC)
xomega



The following guide helps you with initial creation of model objects from existing database tables.

  1. Make sure your model has no objects, e.g. from the previous runs of the import.
  2. If your database tables use SQL types that are not mapped to any logical type in the model, define new logical types that map to those SQL types respectively.
  3. If you want certain tables to be imported as child objects, make sure that there is a foreign key relationship set up to the corresponding parent table, the column names on both ends of the relationship match exactly, and the delete action is set to Cascade.
  4. If you have multiple tables using the same set of common columns, e.g. create date, create user, last update date, last update user, and you want them to be modeled using a shared field set, then you need to define such a field set in the model first.
  5. Open the Properties tab (F4) of the Import from Database generator from the Model Enhancement generator folder.
  6. Set up the database connection and save it either for the generator or as a project default.
  7. Update the Output Path to where you want the model objects imported. Use the {File} placeholder to indicate the location of individual objects. You can also use the {Module/} placeholder to place objects in different folders based on the SQL server schemas of the corresponding tables.
  8. Run the generator and review the generated objects.
  9. If you need to update the model or the database and rerun the generator, then repeat the above steps.
  10. If the objects were generated properly, then update the Output Path to point to another folder, so that accidentally rerunning the generator wouldn't overwrite your model files.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Copyright © 2009-2022 Xomega.Net. All rights reserved.