public String updateSetColumnsForce(Class<?> entityClass, String entityName, boolean notNull, boolean notEmpty) {
        StringBuilder sql = new StringBuilder();
        sql.append("<set>");
        //获取全部列
        Set<EntityColumn> columnSet = EntityHelper.getColumns(entityClass);
        //对乐观锁的支持
        EntityColumn versionColumn = null;
        //当某个列有主键策略时，不需要考虑他的属性是否为空，因为如果为空，一定会根据主键策略给他生成一个值
        for (EntityColumn column : columnSet) {
            if (column.getEntityField().isAnnotationPresent(Version.class)) {
                if (versionColumn != null) {
                    throw new VersionException(entityClass.getCanonicalName() + " 中包含多个带有 @Version 注解的字段，一个类中只能存在一个带有 @Version 注解的字段!");
                }
                versionColumn = column;
            }
            if (!column.isId() && column.isUpdatable()) {
                if (column == versionColumn) {
                    Version version = versionColumn.getEntityField().getAnnotation(Version.class);
                    String versionClass = version.nextVersion().getCanonicalName();
                    //version = ${@tk.mybatis.mapper.version@nextVersionClass("versionClass", version)}
                    sql.append(column.getColumn())
                        .append(" = ${@tk.mybatis.mapper.version.VersionUtil@nextVersion(")
                        .append("@").append(versionClass).append("@class, ")
                        .append(column.getProperty()).append(")},");
                } else if (notNull) {
                    sql.append(this.getIfNotNull(entityName, column, column.getColumnEqualsHolder(entityName) + ",", notEmpty));
                } else {
                    sql.append(column.getColumnEqualsHolder(entityName) + ",");
                }
            }
        }
        sql.append("</set>");
        return sql.toString();
    }
public String updateSetColumnsForce ( Class < ? > entityClass , String entityName , boolean notNull , boolean notEmpty ) { StringBuilder sql = new StringBuilder ( ) ; sql . append ( "<set>" ) ; Set < EntityColumn > columnSet = EntityHelper . getColumns ( entityClass ) ; EntityColumn versionColumn = null ; for ( EntityColumn column : columnSet ) { if ( column . getEntityField ( ) . isAnnotationPresent ( Version . class ) ) { if ( versionColumn != null ) { throw new VersionException ( entityClass . getCanonicalName ( ) + " 中包含多个带有 @Version 注解的字段，一个类中只能存在一个带有 @Version 注解的字段!" ) ; } versionColumn = column ; } if ( ! column . isId ( ) && column . isUpdatable ( ) ) { if ( column == versionColumn ) { Version version = versionColumn . getEntityField ( ) . getAnnotation ( Version . class ) ; String versionClass = version . nextVersion ( ) . getCanonicalName ( ) ; sql . append ( column . getColumn ( ) ) . append ( " = ${@tk.mybatis.mapper.version.VersionUtil@nextVersion(" ) . append ( "@" ) . append ( versionClass ) . append ( "@class, " ) . append ( column . getProperty ( ) ) . append ( ")}," ) ; } else if ( notNull ) { sql . append ( this . getIfNotNull ( entityName , column , column . getColumnEqualsHolder ( entityName ) + "," , notEmpty ) ) ; } else { sql . append ( column . getColumnEqualsHolder ( entityName ) + "," ) ; } } } sql . append ( "</set>" ) ; return sql . toString ( ) ; }
update set列

@param entityClass
@param entityName  实体映射名
@param notNull     是否判断!=null
@param notEmpty    是否判断String类型!=''
@return