Class DynamicListAttributeService


  • public class DynamicListAttributeService
    extends Object
    The service for a dynamic list attribute
    • Constructor Detail

      • DynamicListAttributeService

        public DynamicListAttributeService()
    • Method Detail

      • findPotentialMainTables

        public static Set<DbViewDef> findPotentialMainTables​(QuerySchema schema)
        The method search a potential main tables in a QuerySchema model
        Parameters:
        schema - the query schema model, can't be null
        Returns:
        Set of a potential main table for DynamicList type attribute. If schema does not contain a potential main tables then returns empty Set
      • findPotentialMainTables

        public static Set<DbViewDef> findPotentialMainTables​(QuerySchemaSelectQuery query)
        The method search a potential main tables in a QuerySchemaSelectQuery model
        Parameters:
        query - the query for searching, can't be null
        Returns:
        Set of a potential main table for DynamicList type attribute. If schema does not contain a potential main tables then returns empty Set
      • createQueryText

        public static String createQueryText​(DbViewDef dbView,
                                             ScriptVariant lang)
        Gets query text by DbViewDef. The query has next structure:
        Parameters:
        dbView - DbViewDef for creating query text, can be null
        lang - current ScriptVariant got generating query, can't be null
        Returns:
        query text by DbViewDef, never null. If dbView is null of doesn't have name empty string will be returned
      • addStandardFields

        public static String addStandardFields​(String baseQuery,
                                               DbViewDef mainTable,
                                               IDtProject dtProject,
                                               ScriptVariant scriptVariant)
        Adds standard fields to exiting query for dynamic list from main table
        Parameters:
        baseQuery - base query text, cannot be null
        mainTable - select main table for dynamic list, cannot be null
        dtProject - actual IDtProject, cannot be null
        scriptVariant - current script variant for the project, cannot be null
        Returns:
        base query text with parts corresponging to the standards fields, never null
      • addStandardFields

        public static String addStandardFields​(QuerySchema schema,
                                               String baseQuery,
                                               DbViewDef mainTable,
                                               IDtProject dtProject,
                                               ScriptVariant scriptVariant)
        Adds standard fields to exiting query for dynamic list from main table
        Parameters:
        schema - QuerySchema corresponding to the baseQuery text, cannot be null
        baseQuery - base query text, cannot be null
        mainTable - select main table for dynamic list, cannot be null
        dtProject - actual IDtProject, cannot be null
        scriptVariant - current script variant for the project, cannot be null
        Returns:
        base query text with parts corresponging to the standards fields, never null