What is the best way to add new columns to a Table/View in the Store Model when the DB changes?

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
EdB
Posts: 92
Joined: Mon 15 Oct 2012 09:24

What is the best way to add new columns to a Table/View in the Store Model when the DB changes?

Post by EdB » Wed 08 May 2013 15:45

Hi,

I was wondering whether there is a simple method of updating an storage entity rather than updating the whole model from the db. Basically I have added 2 columns to a View(in the DB) and the easiest approach I have at present is to add the 2 columns manually to the View Object in ED. I wish there was some form of right click "sync this Table/View from DB". I do find the "Update Model from Database" to be a little dangerous. I can select just the one View of interest, in "Recreate Model", and then all the other entities disappear because I have not selected them. If I do not "Recreate Model", I see no objects to update.

Thoughts appreciated.

Thanks.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: What is the best way to add new columns to a Table/View in the Store Model when the DB changes?

Post by Shalex » Wed 22 May 2013 13:03

EdB wrote:I was wondering whether there is a simple method of updating an storage entity rather than updating the whole model from the db.
We recommend using Update Model From Database Wizard (do not choose "Recreate Model").
EdB wrote:If I do not "Recreate Model", I see no objects to update.
We cannot reproduce the issue with the latest (5.5.105) build of Entity Developer. Steps for a simple test:
1. Create a view in your database:

Code: Select all

CREATE OR REPLACE VIEW DEPT_VIEW (
  DEPTNO,
  DNAME
)
AS
  SELECT "DEPTNO","DNAME" FROM dept;
2. Add the view to your *.edml model.
3. Replace original view with the following one:

Code: Select all

CREATE OR REPLACE VIEW DEPT_VIEW (
  DEPTNO,
  DNAME,
  LOC
)
AS
  SELECT "DEPTNO","DNAME","LOC" FROM dept;
4. Run Update Model From Database Wizard. The DEPT_VIEW is available on the Choose change action step and the change is detected:
[DEPT_VIEW] Columns were changed.
[LOC] LOC was added.

Please tell us which steps we should follow to reproduce the problem in our environment.

Post Reply