.-1] } def isNotEmpty(content) { return content != null && content.toString().trim().length() > 0 } static String changeStyle(String str, boolean toCamel) { if (!str || str.size() <= 1) return str if (toCamel) {
if (isNotEmpty(it.comment)) { out.println "\t/**" out.println "\t * ${it.comment}" out.println "\t */" } // 这边默认第一个字段为主键,实际情况大多数如此,遇到特殊情况可能需要手动修改 if (isId) { out.println "\t@Column(isPK = true, name = \"${it.realName}\")" isId =...
static String changeStyle(String str, boolean toCamel) { if (!str || str.size() <= 1) return str if (toCamel) { String r = str.toLowerCase().split('_').collect { cc -> Case.LOWER.apply(cc).capitalize() }.join('') return r[0].toLowerCase() + r[1..-1] } else { s...
class SomeGroovyClass { def property1 = 'ha' def field2 = 'ho' def field4 = 'hu' def getField1() { return 'getHa' } def getProperty(String name) { if (name != 'field3') return metaClass.getProperty(this, name) // 1⃣️ else return 'field3' } } def someGroovyClass = ...
(TransformerErrorCode.TRANSFORMER_GROOVY_INIT_EXCEPTION,ex);}}privateStringgetGroovyRule(Stringexpression,List<String>extraPackagesStrList){StringBuffersb=newStringBuffer();if(extraPackagesStrList!=null){for(StringextraPackagesStr:extraPackagesStrList){if(StringUtils.isNotEmpty(extraPackagesStr)){sb.append...
def isNotEmpty(content) {returncontent !=null&& content.toString().trim().length() >0}staticString changeStyle(String str, boolean toCamel) {if(!str || str.size() <=1)returnstrif(toCamel) { String r= str.toLowerCase().split('_').collect { cc -> Case.LOWER.apply(cc).capitalize...
}defisNotEmpty(content) {returncontent !=null&& content.toString().trim().length() >0}staticString changeStyle(String str,booleantoCamel) {if(!str || str.size() <=1)returnstrif(toCamel) { String r = str.toLowerCase().split('_').collect { cc -> Case.LOWER.apply(cc).capitalize(...
if (isNotEmpty(it.commoent)) { out.println "\t/**"out.println "\t * ${it.commoent.toString()}"out.println "\t */"} if (it.annos != "") out.println " ${it.annos}"out.println " private ${it.type} ${it.name};"} out.println ""//get set fields.each() { out....
{if (CollUtil.isNotEmpty(ruleFilters)) {returnruleFilters;}ruleFilters.addAll(springRuleFilterList);ruleFilters.addAll(this.filterRegistry.values());Collections.sort(ruleFilters);returnruleFilters;}private Class compile(File file) throws IOException {GroovyClassLoader loader = getGroovyClassLoader();...
\"" + tableComment + "\")"72 out.println "@Table(name = \"" + table.getName() + "\")"73 out.println "public class $className {"74 out.println ""75 fields.each() { 76// 输出注释 77// if (isNotEmpty(it.commoent)) { 78// out.println " /**"