Model items are associated with columns (columns) of tables in the database. You can set this details.
You can specify "model item detail definition> details> database details".
It is enabled by standard.In this case, a column (column) is created in the table corresponding to the model.
When this setting is invalid, no columns are prepared in the table.
It can be used when it is not necessary to save it in the database as an item derived by calculation.
Wagby automatically creates an index (for the table) that matches the following conditions.
By disabling this setting, creation of indexes is suppressed.
The "integer type" and "string type" specified in the repository are "It automatically converts to each type prepared by each database. For example, when using MySQL, the string type is treated as varchar (255).
You can specify this type in detail.Figure 2 shows an example of changing the type of table definition to varchar (1024) for string type items.
In the model reference item, if the primary key of the referenced model specifies the type of the table definition, check "Apply the same settings as the table definition type of the referenced item".
This setting can be checked only when this item is model reference.If checked, "Type of table definition" can not be entered.(This setting takes precedence.)
Normally, the "item ID" (in English) of the model item is used as the column name of the table.You can change this behavior by specifying "physical column name".
Physical column names can be specified arbitrarily in other model reference items that refer to a compound key model.
In the entry column of the physical column name item, enter the physical column name (s), separated by commas.
If you set a unique constraint, you can not register the same data duplicately.As shown in Figure 4, specify the constraint name.
You can also set unique constraints combining multiple items.Figures 5 and 6 are constrained to be unique with two names "name" and "name".in this waySame constraint nameTo each item.
The behavior when saving part of the items for which unique constraint settings have been made as unentered (null) depends on the database.
Define unique constraints for fields A, B, and C.Here, we will register the data A: aaa, B: null, C: ccc. After that, if you try to register data of A: aaa, B: null, C: ccc again, it becomes as follows.
For details, please read the manual of your database.
The setting of the unique constraint specified here can be confirmed with the following file.
You can check the contents of the file with a text editor.The following DDL is included.
alter table "モデルID" add constraint jfcuk_モデルID_設定した名前 unique ("項目名");
init_db.bat When executed, this alter statement is also executed at the same time.
The unique constraint name is adjusted according to the maximum length of the constraint name permitted by the database to be used.
Specifically, if the name exceeds the maximum length, it will be abbreviated.(As a result of abbreviation, in case of duplication, assign a unique name so as not to duplicate this.This also applies to table names and item names.)
You can change the rules of lock keys managed internally by Wagby.Normally, this setting is not performed.
Detail is"WDN> Lock key customizationPlease read.
"Business logic> Cross-model calculation (transaction)Please read.