private static void generateSelectiveToTrimEleTo(XmlElement trimEle, IntrospectedColumn introspectedColumn, String prefix, int type) {
        if (type != 3 && (introspectedColumn.isSequenceColumn() || introspectedColumn.getFullyQualifiedJavaType().isPrimitive())) {
            // if it is a sequence column, it is not optional
            // This is required for MyBatis3 because MyBatis3 parses
            // and calculates the SQL before executing the selectKey

            // if it is primitive, we cannot do a null check
            generateSelectiveCommColumnTo(trimEle, introspectedColumn, prefix, type);
        } else {
            XmlElement eleIf = new XmlElement("if");
            eleIf.addAttribute(new Attribute("test", introspectedColumn.getJavaProperty(prefix) + " != null"));

            generateSelectiveCommColumnTo(eleIf, introspectedColumn, prefix, type);

            trimEle.addElement(eleIf);
        }
    }
private static void generateSelectiveToTrimEleTo(XmlElement trimEle, IntrospectedColumn introspectedColumn, String prefix, int type) {
        if (type != 3 && (introspectedColumn.isSequenceColumn() || introspectedColumn.getFullyQualifiedJavaType().isPrimitive())) {
            
            
            

            
            generateSelectiveCommColumnTo(trimEle, introspectedColumn, prefix, type);
        } else {
            XmlElement eleIf = new XmlElement("if");
            eleIf.addAttribute(new Attribute("test", introspectedColumn.getJavaProperty(prefix) + " != null"));

            generateSelectiveCommColumnTo(eleIf, introspectedColumn, prefix, type);

            trimEle.addElement(eleIf);
        }
    }
private static void generateSelectiveToTrimEleTo ( XmlElement trimEle , IntrospectedColumn introspectedColumn , String prefix , int type ) { if ( type != 3 && ( introspectedColumn . isSequenceColumn ( ) || introspectedColumn . getFullyQualifiedJavaType ( ) . isPrimitive ( ) ) ) { // if it is a sequence column, it is not optional // This is required for MyBatis3 because MyBatis3 parses // and calculates the SQL before executing the selectKey // if it is primitive, we cannot do a null check generateSelectiveCommColumnTo ( trimEle , introspectedColumn , prefix , type ) ; } else { XmlElement eleIf = new XmlElement ( "if" ) ; eleIf . addAttribute ( new Attribute ( "test" , introspectedColumn . getJavaProperty ( prefix ) + " != null" ) ) ; generateSelectiveCommColumnTo ( eleIf , introspectedColumn , prefix , type ) ; trimEle . addElement ( eleIf ) ; } }
生成选择列到trim 节点
@param trimEle
@param introspectedColumn
@param prefix
@param type               1:key,2:value,3:set
生成选择列到trim 节点