Entity Method Table Initializer

Method Input Parameters

Field's Description

  • Method Name Need to provide the name of the Entity method. Entity method name should be unique for that database

  • Target Method Source

    Read Methods

    Cumulative Read Method: Read methods specified at method level for all response tables

    Non-Cumulative Read Method:  Read methods specified at each table level

     

     

    Request Tables for Read Methods:

     

    Request table is specified when there are parameters in SP or query or DLL methods (Method Type 2,3, 4, 6).

     

    In the query method below, @order_no is a parameter

    select * from order_detail where order_no = @order_no

     

    There are no parameters in the query method below. No request table is specified.

    select * from order_detail

    Request table can also be specified for Table Method (Method Type 1).  Its use is illustrated below.

     

    Target_method_source =  order_detail

    Request Table = OrderRequest, that has one field OrderNo whose db_column_name = order_no

     

    When the entity engine sees a request table specified, it is converted to a query like below

    select * from order_detail where order_no = @order_no

     

    This is useful when selecting just the records for particular order, instead reading the whole table.

     

    Deferred read

     

    Deferred read is applicable only to non-cumulative methods. It means the records are read, by execute the method, on navigating to the parent record for the first time.  Taking an example of a non-cumulative method, with two tables (parent-child). The child table records are read only when needed. On navigating to a specific parent record, child table records are fetched using parent table’s key.

     

    On non-cumulative methods, Deferred Read is set on child tables, as stated in table below.

    Method Type Request Tables specified Deferred Read Comments
    Query/SP Yes Yes If there is a request table, it means child table’s read method has parameters that uses parent table’s row value(s).
    Query/SP No No If there is no request table, the child table’s read method fetches data only once.
     
     
    Query is executed only once and all records are read
    Table Not Applicable Yes For any child table’s, whose read method is a non-cumulative method and has method_type = 1, it always set as deferred method.

     

    When to use Deferred Methods?

     

    Deferred Read fetches the child records as needed, and is required to execute the method on parent record navigation.  The fetch is performed only when navigating the parent for the first time, reused when the parent record is re-navigated.

     

    Non-deferred Read fetches all child records along with parent table. All child table records are read into memory (temp tables). On parent record navigation appropriate child records are filtered using parent key.

    Deferred read should be used when child tables are large (1000’s of records).  Non-Deferred will be useful when all of the child table records are a small (less few hundred records).   When child table records are small the non-deferred read method performance will be higher than deferred read method.

  • Method Type This specifies type for the db_method_name_core. The following types are possible

    0: System

    1: Table

    2: Sql

    3: SP (Non-Entity Compliant)

    4: SP (Entity Compliant)

    5: WCF URL

    6 : DLL

    Method Type:

     

    Table Type Description Notes
    0 System Reserved, do not use
    1 Table Method where database table is directly used.
    2 SQL Method is specified as SQL Statements. SQL may or may not have parameters
    3 SP (non-Entity Compliant) All SQL Server stored procedure (SP) methods. SP may or may not have parameters
    4 SP (Entity Compliant) It is only used few areas now. Do not use this method
    5 WCF URL Not implemented, do not use
    6 DLL For all DLL methods

     

     

  • Prefix Any term like Application/Module name that need to prefixed with the Entity/Method/Table names can be provided.

Method Parameters

Field's Description

  • 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).

  • 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).

  • Value This is the default value defined by the entity. It may be different/overriden from the value specified in target_default_value, which are: table default value, SP parameter default value, DLL method default value.