Groovy判断表ID是否int

    xiaoxiao2022-06-24  191

    //判断表是否为自增长 true 是 false 否 def isAutoIncrement(table){ boolean auto = false DasUtil.getColumns(table).reduce([]) { ff, col -> def spec = Case.LOWER.apply(col.dataType.specification) def typeStr = typeMapping.find { p, t -> p.matcher(spec).find() }.value if(col.getName() == "id"){ if(typeStr == "int" || typeStr == "Long" || typeStr == "long"){ auto = true } } } return auto }

     


    最新回复(0)