Making copies of entities in Schema Modeller?

schema

(Stuart Clennett) #1

Hi,

I have several (15 or more) entities in the Schema Modeller. Each is a join on several tables (so not Auto-SQL) and each has a lot of field properties set – I use the field custom attributes a lot in order to drive the display of data in the client.

I need to create a load more entities that are extended versions of the ones that exist (in other words, adding fields by adding more table joins in the SQL).

(Ideally SM should have a “Copy table…” function here)

I really do not want to have to create all these entities by hand again - SM is very painful & non-keyboard friendly when there’s lots of fields to edit (constantly having to switch between keyboard & mouse and no ability to add custom attributes to multiple fields at once, hence a lot of copy/pasting).

My thoughts were to copy the entire schema component to a new data-service and make the necessary changes, but ideally I’d like to have all the entities in the same schema.

Is it possible to create a copy of the .daSchema file and then somehow merge the two back together again? (Seems like it would be a painful process through a text editor)?

Thanks

Stuart


(EvgenyK) #3

Hi,

as a temporary workaround - you can create a simple program that will duplicate required tables.
it can be something like

schema.LoadFromFile('my.daSchema');
oldtable := schema.Datasets.DatasetByName('myname') ;
newtable := schema.Datasets.Add;
newtable.Assign(oldtable);
newtable.Name := 'newname';
schema.SaveToFile('my.daSchema');

(antonk) #4

The easiest way is to do the required copy procedures using the code similar to the one in the previous message. Direct changes via a text editor will have a great chance of damaging the .daSchema file.


(Stuart Clennett) #5

Thanks Evgeny & Anton.

Wish I’d realised this a long time ago :smile: