I'm quite new to Entity Developer. I plan to import roughly 50 tables into a model from an existing Oracle database. Each of the tables has two fields to keep track of the last update: LAST_UPDATE_ID and LAST_UPDATE_DATE.
Is there a way to apply a rule that all occurrences of the LAST_UPDATE_ID column would be set to USER on insert or update, and that all occurrences of LAST_UPDATE_DATE would be set to SYSDATE on insert or update?
common behavior for common columns
Re: common behavior for common columns
Maybe I should add that we anticipate the table content being exposed through a Web API.
I know that Entity Developer allows one to specify default values in Model Explorer under the *.Store node. I'm trying to figure out how to make this happen without having to manually apply the USER and SYSDATE default values to each table.
I know that Entity Developer allows one to specify default values in Model Explorer under the *.Store node. I'm trying to figure out how to make this happen without having to manually apply the USER and SYSDATE default values to each table.
Re: common behavior for common columns
Any suggestions from anyone? There MUST be a better way than setting each of the fields' default values by hand.
Re: common behavior for common columns
You can do this in the following way: expand all nodes of needed tables in *.Store (it is more convenient to go from down to upside when opening nodes with arrows of your keyboard), then select all LAST_UPDATE_ID columns keeping Ctrl key pressed and set Default Value=USER for all selected columns simultaneously. The LAST_UPDATE_DATE columns can be initialized similarly.
Another way: select diagram surface and press Ctrl + F and look for LAST_UPDATE_ID, then double click on each found LAST_UPDATE_ID in the Model Find Results window and insert (Ctrl + V) USER into Default Value.
One more way: modify your T4 template to initialize default values of LAST_UPDATE_ID and LAST_UPDATE_DATE properties in conceptual (CSDL) part of the model.
Another way: select diagram surface and press Ctrl + F and look for LAST_UPDATE_ID, then double click on each found LAST_UPDATE_ID in the Model Find Results window and insert (Ctrl + V) USER into Default Value.
One more way: modify your T4 template to initialize default values of LAST_UPDATE_ID and LAST_UPDATE_DATE properties in conceptual (CSDL) part of the model.
Re: common behavior for common columns
Thank you for the suggestions! I'll begin trying them right away.