Features artisan associations and their properties illustrates
According to base article workmen are compositions like:
Note: Made to end the Association had a multiplicity
*
, but the beginning of 1
or ‘0..1` (otherwise: perform the Association from the artisan class to internal). Artisan class must always be from the beginning of the Association, and the inner side of the end. Note: When editing an Association to class diagram you need to take into account existing features.
This will generate an Association. The generation of SQL DDL. The structure definition DDL SQL is created like this:
- In the table, respectively. internal class - link table, respectively. Masterova классу;
- Constraint linking table.
Generation in .Net language. In the inner class, private member of type master and a public virtual property with the appropriate modifier (# - protected, - public, - private), named like the role name in the side of the wizard. Cm. structure of the classes of data objects.
Additional editable properties and how that is generated
Properties artisan Association:
Property Description | Generate SQL DDL Generation .Net language | |
---|---|---|
Description - description |
No | Description in the DocComment property to the inner class if left blank, DocComment is not generated. |
StartRole - the name of the role from the beginning (from the master) |
a field Name in the table of the inner class, it is a foreign key to table artisan class, if another name is specified by the Storage property | property Name and private member of inner class |
StartMultiplicity power of the Association from the beginning (from the master) |
If power is 1, in a DDL CREATE TABLE script for the table, respectively. internal class in the field definition specifies NOT NULL. If the capacity 0..1 - NULL | If power is 1, - before the property in an internal class is generated by specifying the attribute NotNullAttribute (Namespace: ICSSoft.STORMNET, Assembly: ICSSoft.STORMNET.DataObject (in ICSSoft.STORMNET.DataObject.dll)) |
StartRoleAccessModifier modifier from the beginning (from the master) |
No | Applicable modifier properties (# - protected, - public, - private) |
StartRoleStored |
foreign key Field in the table, respectively. the inner class is not generated. Before the property definition is specified .Net-NotStoredAttribute attribute (Namespace: ICSSoft.STORMNET, Assembly: ICSSoft.STORMNET.DataObject (in ICSSoft.STORMNET.DataObject.dll)) | |
EndRole - the name of the role from the end that duplicates the chart |
Does | Not used (reserved) |
EndMultiplicity power of the Association from the beginning, duplicates |
No way | Not used (reserved) |
AutoGenerateTypeUsage - automatic generation types. |
DDL table definition for inner class are generated foreign keys for each found class. The fields are named as follows: @@ |
Masterovoy property of the interior class .NET-attribute TypeUsageAttribute, showing all the found classes. |
Storage - name store |
If specified, this will be the field name of the foreign key, not StartRole. Before the property definition is generated specifying attribute PropertyStorageAttribute (Namespace: ICSSoft.STORMNET, Assembly: ICSSoft.STORMNET.DataObject (in ICSSoft.STORMNET.DataObject.dll)) | |
TypeUsage - an explicit reference types. Is ignored if the flag is AutoGenerateTypeUsage. You can specify the names of the types used (the names of the artisan class and any of its successors, which should be relevant the artisans Association), separated by commas. |
DDL table definition for inner class are generated foreign keys for each of the classes. The fields are named as follows: @@ |
Masterovoy property of the interior class .NET-attribute TypeUsageAttribute, indicating these classes. |
AutoStoreMasterDisabled - disable automatic saving of the workman of the object while keeping the main subject. |
No | Before the definition of artisan properties is generated specifying attribute AutoStoreMasterDisabled (Namespace: ICSSoft.STORMNET, Assembly: ICSSoft.STORMNET.DataObject (in ICSSoft.STORMNET.DataObject.dll)) |
PBMasterCustomAttributes |
in any Way | If the option is given, it is generated bracket programmer for manual application .Net attributes before the code properties. |
PBMasterGetEnd |
in any Way | If the option is given, it is generated bracket programmer for manual entering of code before the end of the getter. |
PBMasterGetStart |
in any Way | If the option is given, it is generated bracket programmer to “manual” any code after the beginning of getter. |
PBMasterSetEnd |
in any Way | If the option is given, it is generated bracket programmer for manual entering of code before the end of the set accessor. |
PBMasterSetStart |
in any Way | If the option is given, it is generated bracket programmer for manual entering the code after the set accessor. |
Automatic generation works as follows:
- Finds all heirs artisan class (within stage);
- Classes were found, along with the workman class, sorted by name on возрастанию;
- The result is the definition of a types.
Example
For the above chart on the C# code looks like this:
private ICSSoft.BugLeR.Пользователь fРегистратор;
// ........
// *** Start programmer edit section *** (Error.The Registrar CustomAttributes)
// *** End programmer edit section *** (Error.The Registrar CustomAttributes)
[NotNull())
public virtual ICSSoft.BugLeR.Пользователь Регистратор
{
get
{
// *** Start programmer edit section *** (Error.Logger Get start)
// *** End programmer edit section *** (Error.Logger Get start)
ICSSoft.BugLeR.Пользователь result = this.fРегистратор;
// *** Start programmer edit section *** (Error.Logger Get end)
// *** End programmer edit section *** (Error.Logger Get end)
return result;
}
set
{
// *** Start programmer edit section *** (Error.The Registrar Set start)
// *** End programmer edit section *** (Error.The Registrar Set start)
this.fРегистратор = value;
// *** Start programmer edit section *** (Error.The Registrar Set end)
// *** End programmer edit section *** (Error.The Registrar Set end)
}
}