Class FieldsEditor


  • public final class FieldsEditor
    extends Object
    Editing operations with fields collection
    • Method Detail

      • addField

        public static void addField​(QueryWizardSource source,
                                    QuerySchemaExpression newField,
                                    NestedTableExpression parentNestedTable,
                                    String alias)
        Adds a new expression
        Parameters:
        source - query wizard source
        newField - new expression
        parentNestedTable - parent nested table, null if have no
        alias - expression alias
      • addField

        public static void addField​(QueryWizardSource source,
                                    QuerySchemaExpression newField,
                                    NestedTableExpression parentNestedTable,
                                    int mappingPos)
        Adds a new expression
        Parameters:
        source - query wizard source
        newField - new expression
        parentNestedTable - parent nested table, null if have no
        mappingPos - fields matching position
      • addField

        public static void addField​(QueryWizardSource source,
                                    QuerySchemaExpression newField,
                                    NestedTableExpression parentNestedTable,
                                    int mappingPos,
                                    String alias)
        Adds a new expression
        Parameters:
        source - query wizard source
        newField - new expression
        parentNestedTable - parent nested table, null if have no
        mappingPos - fields matching position
        alias - expression alias
      • isNullExpression

        public static boolean isNullExpression​(Object expression)
        Check is expression is NULL
        Parameters:
        expression -
        Returns:
        true if expression is NULL
      • isEmptyExpression

        public static boolean isEmptyExpression​(Object expression)
        Check is expression empty
        Parameters:
        expression -
        Returns:
        true if expression is empty
      • isEmptyNestedTable

        public static boolean isEmptyNestedTable​(AbstractExpression expression)
        Check is expression is empty nested table
        Parameters:
        expression -
        Returns:
        true if expression is empty nested table
      • createNullExpression

        public static QuerySchemaExpression createNullExpression()
        Create NULL expression
        Returns:
        new NULL expression
      • createNullExpression

        public static QuerySchemaExpression createNullExpression​(boolean emptyField)
        Create NULL expression
        Parameters:
        emptyField - create empty field
        Returns:
        new NULL expression
      • createEmptyNestedTable

        public static QuerySchemaExpression createEmptyNestedTable()
        Create empty nested table
        Returns:
        new empty nested table
      • similarNames

        public static boolean similarNames​(org.eclipse.emf.ecore.EObject field1,
                                           org.eclipse.emf.ecore.EObject field2,
                                           QueryWizardSource source)
        Compare two expressions
        Parameters:
        field1 - may be QuerySchemaExpression or AbstractExpression
        field2 - may be QuerySchemaExpression or AbstractExpression
        Returns:
        true if field1 and field2 is the similar
      • getNotNullFieldsCount

        public static int getNotNullFieldsCount​(List<QuerySchemaExpression> fields)
        Calculating not null fields in collection
        Parameters:
        fields -
        Returns:
        not null fields count
      • getFieldContainerFields

        public static org.eclipse.emf.common.util.EList<QuerySchemaExpression> getFieldContainerFields​(QuerySchemaExpression field)
        Get field container
        Parameters:
        field -
        Returns:
        parent fields collection
      • getMatchedFieldInOperator

        public static QuerySchemaExpression getMatchedFieldInOperator​(QuerySchemaExpression firstField,
                                                                      int operatorIndex,
                                                                      QueryWizardSource source)
        Get matched field in operator
        Parameters:
        field - from first operator
        index - of operator
        Returns:
        Field matched with firstField by alias, or null if firstField is not funded in current query