Package com.jfinal.ext.plugin.tablebind

Examples of com.jfinal.ext.plugin.tablebind.TableBind


  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() + ")");
        }
      }
View Full Code Here


  @Override
  public boolean start() {
    if (includeClasses.size() <= 0) {
      includeClasses = ClassSearcherExt.of(Model.class).classpaths(includeClassPaths).injars(includeJars).includeAllJarsInLib(includeAllJarsInLib).search();
    }
    TableBind tb = null;
    for (Class modelClass : includeClasses) {
      if (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() + ")");
        }
      }
View Full Code Here

TOP

Related Classes of com.jfinal.ext.plugin.tablebind.TableBind

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.