public boolean start() {
if (includeClasses.size() <= 0) {
// includeClasses = ClassSearcherExt.of(Model.class).includepaths(includeClassPaths).injars(includeJars).includeAllJarsInLib(includeAllJarsInLib).search();
includeClasses = ClassSearcherExt.of(Model.class).includepaths(includeClassPaths).search();
}
TableBind tb = null;
for (Class modelClass : includeClasses) {
boolean isexclude = false;
if (excludeClassPaths.size() > 0) {
for (String excludepath : excludeClassPaths) {
log.error(modelClass.getName());
if (modelClass.getName().startsWith(excludepath)) {
isexclude = true;
break;
}
}
}
if (isexclude || excludeClasses.contains(modelClass)) {
continue;
}
tb = (TableBind) modelClass.getAnnotation(TableBind.class);
String tableName;
if (tb == null) {
if (!autoScan) {
continue;
}
tableName = nameStyle.name(modelClass.getSimpleName());
this.addMapping(tableName, modelClass);
log.debug("addMapping(" + tableName + ", " + modelClass.getName() + ")");
} else {
tableName = tb.tableName();
if (StrKit.notBlank(tb.pkName())) {
this.addMapping(tableName, tb.pkName(), modelClass);
log.debug("addMapping(" + tableName + ", " + tb.pkName() + "," + modelClass.getName() + ")");
} else {
this.addMapping(tableName, modelClass);
log.debug("addMapping(" + tableName + ", " + modelClass.getName() + ")");
}
}