Fields
- Fields are the properties of Entities
- Entity Fields are used to represent a column of the data table in the database
- It is necessary to ensure that the Entity fields have the same data type as the column they are representing
- Entity fields are also responsible for creating various relationships between the entities. This is similar to the concept of primary and foreign keys in the database
- In the NF Tool, a single entity field can be used in multiple entity tables if it matches a few conditions like having same database column name and data type
Fields
Field's Description
Has Error? This is internal field. If there is any inconsistency/improper in the setting of the entity/entity table/entity field, or if the steps that need to be followed in creating the entity is not followed, then “Has Error” will be highlighted in red color. Clicking it will provide the details of what that error was, with suggestions to fixing the error.
Field Name Field Name is a unique business element. For example, AccountNo is unique representation of Customer Account across Cadebill. This appear in different database tables as primary and foreign keys. The goal here is to uniquely identify such business elements. Name of the field is referenced from EF.fields table.
When adding new field name, developer need to follow the proper naming conventions. It should always start with an alphabet.
There should not be any spaces, underscore in the field name. Should use camel case. Like AccoutNo, AccountTypeId.
Avoid special characters, reserved key words.
Db Column Name Need to enter the Db column name in square brackets. For example [account_no].
Db Data Type Need to enter the correct data type of database column name. This need to match correctly with the data type of the parameter (request table case) / output (response table case). Otherwise, Entity validation error will be get shown. For example, if that field returned from database is of varchar(256), you cannot set the “Db Data Type” as varchar(250).
Field Label A short description, used to show in the UI. This field label text will be inherited from what it is set at Field level. So, no need to provide it unless, a different value is needed to be shown for this Method.
Description A short explanation of what that Entity object is created for, what it will do.
Base Field Name
If that new field name is child of or related to an existing field name, then need to select that existing field as “Base Field Name”. Following are couple of examples for this case.
When you have 2 fields like AccountNo and ParentAccountNo. And when ParentAccountNo is child of that field AccountNo, then for ParentAccountNo, developer need to set AccountNo field as base field name.
And when you have fields StartDate and ProductStartDate, and get them used for 2 different cases. Though both of them are not related, StartDate should be base field name for ProductStartDate, and for various other field names that are used for start date cases.
One important thing to note is, when you set some field as base field name for another field, data types of those fields need to be same. Otherwise you cannot set it. Entity validation error will be get raised for that.
See also “Is Parent Of Base Field?” below.Array Of Base Field Name
If the current new field name is related to an existing field name and when an array of values of that existing field is going to be get stored in this new field, then the developer need to specify that existing field name as “Array of Base Field Name” for this new field.
For example, when you have fields “AccountNo” and “AccountNos”. In field AccountNo store an individual account number value, and in AccountNos store multiple account number values separated by comma or any other character. Then for the field “AccountNos”, you need to set field “AccountNo” as array of base field.Root Table Name The table_name where the value for this field first originates. e.g. AccountNo originates in Account table, and is referenced by other tables.
Lookup Name Normally you will be setting a lookup for a field, at entity method table fields level. When setting a lookup at field level, it will be get created as shared lookup. When adding an lookup at the entity field level, you need to make sure that, that lookup’s entity method do not have a request table.
Need to provide the lookup name. It should be unique for the application. Give a name that is easily identifiable for the use of that lookup..Is Parent Of Base Field?
If the current field name is child of an another field (have base field name), then need to set this “Is Parent Of Base Field” to true. Then NF engine will get the relations set properly for these fields.
As we have seen above for “Base Field Name”, there could be cases that a field is set as base field for another field, but both of them are not related – in StartDate and ProductStartDate example. But fields AccountNo and ParentAccoutNo are related, ParentAccountNo is child to AccountNo. So, for field ParentAccountNo, need to set this “Is Parent Of Base Field” as true.
By default, this option is false.Is Generic?
- Generic fields will have the same meaning and business purpose wherever used. However, the data is specific to the context of the table where it is stored. The values in each table is independent of the values in other tables. There will not be any “root table name” for generic fields. e.g. DateOfBirth for Student, DateOfBirth for Staff. Both mean the same, entered independently, and the data entered in Student and Staff tables not related to each other.
- Standard (non-generic, non-abstract) fields will have the same meaning and business purpose wherever used. The data value has same meaning across all tables, and are relatable through entity parent-child relationship. There will be a root table name for each field. Data is entered in root table, and it is propagated to multiple tables by reference. e.g. OrderNo is entered originally in Orders table, and the OrderNo value is reused in OrderDetails table. Both tables are related by OrderNo key.
- Abstract fields will not be used directly in any table. A derived field from the abstract field will be used as a field in any table.
- By default, this option is false.
Polymorphic Fields
Under certain conditions, field_name is equivalent to one or more other fields.
e.g. ItemType, ItemId
When ItemType = ’P’, ItemId = ProductId
When ItemType = ’S’, ItemId = ServiceId
ItemId is polymorphic key representing many Itemtypes. The value in ItemType says what type ItemId represents. (ItemType + ItemId) is the unique key
The value in this "polymorphic_fields" is a JSON (or XML) string with the following JSON format
[
{
"PolymorphicFieldName":"ProductId",
"PolymorphicMethodName":null,
"PolymorphicConditionFields":[
{
"PolymorphicConditionFieldName":"ItemType",
"PolymorphicConditionFieldValue":"P"
}
]
},
{
"PolymorphicFieldName":"ServiceId",
"PolymorphicMethodName":null,
"PolymorphicConditionFields":[
{
"PolymorphicConditionFieldName":"ItemType",
"PolymorphicConditionFieldValue":"S"
}
]
}
]
Is Abstract?
A field may be defined as abstract field, which requires further definition by the (UI) developer or during setup time for a customer installation. This is one of the areas, where a partial abstract entity will be defined fully by the developer/customer specific setup.
This is needed for the purposes of dynamic fields. Dynamic field will be treated as "base_field_name" and there could be 0 or more occurrence of the base fields. The occurrence limit will be defined in min_occurs, max_occurs.
Note: See generic field for explanation. By default, this option is false.Used Count Internal field. Used to show the count of entity tables this field is been used.
Row Identifier Internal field.
Created User User who created that Entity object.
Created Date Date in which Entity object was created.
Updated User User who updated that Entity object lastly.
Updated Date Date in which Entity object was last modified.
Fields used by following Tables
This screen is for display purpose only.
Under Fields grid, when an entity field is selected, in the right side it will show in a grid, details of entity methods and entity tables in which that selected entity field is used, with the data type that is used for that field in those entity tables, and whether it is a request table or response table.
It will be very helpful for the developer.
There will be hyperlinks on entity table name and entity method name. Clicking on it will take it to respective entity table / entity methods.
Field's Description
Field Name Field Name is a unique business element. For example, AccountNo is unique representation of Customer Account across Cadebill. This appear in different database tables as primary and foreign keys. The goal here is to uniquely identify such business elements. Name of the field is referenced from EF.fields table.
When adding new field name, developer need to follow the proper naming conventions. It should always start with an alphabet.
There should not be any spaces, underscore in the field name. Should use camel case. Like AccoutNo, AccountTypeId.
Avoid special characters, reserved key words.
Db Data Type Need to enter the correct data type of database column name. This need to match correctly with the data type of the parameter (request table case) / output (response table case). Otherwise, Entity validation error will be get shown. For example, if that field returned from database is of varchar(256), you cannot set the “Db Data Type” as varchar(250).
Table Name
Represents the Entity table name under which the Table Fields are get added. Here it is internal (primary and foreign key) field.
Need to provide the name of the entity table. It should be a unique name for that application.While creating new entity table, need to follow some naming procedures.
Name should reflect for what entity / entity method it is going to be used for.
If the table is going to be a Request table, then suffix the name with “Request”. Example as AccountTypeRequest.
If the table is going to be used for Read purpose, then no need to any suffix. Example as AccountType.
If the table is going to be used for Lookup control, then can name it like AccountTypeLookup.
If the table is going to be used for CUD operation, then can name it like AccountTypeCUD.
Method Name Need to provide the name of the Entity method. Entity method name should be unique for that database
Table Type Internal field, shows whether that entity table is of request or response.
Additional db_column_names for the Field
This table stores *additional* db_column_name(s) for a field_name. If a field_name has multiple db_column_names in application databases (or DLL parameters), then the most predominant db_column_name is stored in EF.fields itself (next to field_name). The second and subsquent db_column_names are stored in this table. table_name provides specifies where such db_column_name is used. For example, predominant Db column name for field name AccountNo is “account_no”. In some places, it would have been named as account_number, account_no, account, etc. For each of these cases, no need to create new field names.
Field's Description
Field Name Field Name is a unique business element. For example, AccountNo is unique representation of Customer Account across Cadebill. This appear in different database tables as primary and foreign keys. The goal here is to uniquely identify such business elements. Name of the field is referenced from EF.fields table.
When adding new field name, developer need to follow the proper naming conventions. It should always start with an alphabet.
There should not be any spaces, underscore in the field name. Should use camel case. Like AccoutNo, AccountTypeId.
Avoid special characters, reserved key words.
Db Column Name "Db Column Name" or "Database Column Name" provides a mapping of an Entity Field for a method’s output.
An entity method may output one or more tables. The "Db Column Name" will be one of the below.
When the Entity "Method Type" = Table, this represent table’s column name.
When the Entity "Method Type" = Query, this represent query’s output column name or the alias of the column name, if an alias available.
When the Entity "Method Type" = SP (non-Entity compliant) or SP (Entity Compliant), this represents a SQL Server Stored Procedure’s output column name.
Entity "Method Type" = WCF URL, is not implemented.
When the Entity "Method Type" = DLL, the DLL output datatype must be either .NET dataset or .NET data table or a scalar value. The "Db Column Name" is the scalar value or a column name of a data table.
The Entity methods are independent in nature, that they may be output columns with their own naming conventions. For example, a customer "Account" may be named as "account" in one method, "account_no" in another method. But all such names point to an Entity Field "AccountNo". The Entity "Field Name" represent unique business name for the application. Nebula Framework architecture provides bringing together disparately named data elements ("Db Column Name") to a unified business name (Field Name).
Table Name
Represents the Entity table name under which the Table Fields are get added. Here it is internal (primary and foreign key) field.
Need to provide the name of the entity table. It should be a unique name for that application.While creating new entity table, need to follow some naming procedures.
Name should reflect for what entity / entity method it is going to be used for.
If the table is going to be a Request table, then suffix the name with “Request”. Example as AccountTypeRequest.
If the table is going to be used for Read purpose, then no need to any suffix. Example as AccountType.
If the table is going to be used for Lookup control, then can name it like AccountTypeLookup.
If the table is going to be used for CUD operation, then can name it like AccountTypeCUD.
Field Db Column Id Internal, identity field.
Row Identifier Internal field.
Created Date Date in which Entity object was created.
Created User User who created that Entity object.
Updated Date Date in which Entity object was last modified.
Updated User User who updated that Entity object lastly.