org.mybatis.generator.logging.LogFactory Java Examples

The following examples show how to use org.mybatis.generator.logging.LogFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DatabaseIntrospector.java    From mapper-generator-javafx with Apache License 2.0 5 votes vote down vote up
public DatabaseIntrospector(Context context,
        DatabaseMetaData databaseMetaData,
        JavaTypeResolver javaTypeResolver, List<String> warnings) {
    super();
    this.context = context;
    this.databaseMetaData = databaseMetaData;
    this.javaTypeResolver = javaTypeResolver;
    this.warnings = warnings;
    logger = LogFactory.getLog(getClass());
}
 
Example #2
Source File: DatabaseIntrospector.java    From mybatis-generator-plus with Apache License 2.0 5 votes vote down vote up
public DatabaseIntrospector(Context context,
        DatabaseMetaData databaseMetaData,
        JavaTypeResolver javaTypeResolver, List<String> warnings) {
    super();
    this.context = context;
    this.databaseMetaData = databaseMetaData;
    this.javaTypeResolver = javaTypeResolver;
    this.warnings = warnings;
    logger = LogFactory.getLog(getClass());
}
 
Example #3
Source File: ShellRunner.java    From mybatis-generator-core-fix with Apache License 2.0 4 votes vote down vote up
private static Map<String, String> parseCommandLine(String[] args) {
    List<String> errors = new ArrayList<String>();
    Map<String, String> arguments = new HashMap<String, String>();

    for (int i = 0; i < args.length; i++) {
        if (CONFIG_FILE.equalsIgnoreCase(args[i])) {
            if ((i + 1) < args.length) {
                arguments.put(CONFIG_FILE, args[i + 1]);
            } else {
                errors.add(getString(
                        "RuntimeError.19", CONFIG_FILE)); //$NON-NLS-1$
            }
            i++;
        } else if (OVERWRITE.equalsIgnoreCase(args[i])) {
            arguments.put(OVERWRITE, "Y"); //$NON-NLS-1$
        } else if (VERBOSE.equalsIgnoreCase(args[i])) {
            arguments.put(VERBOSE, "Y"); //$NON-NLS-1$
        } else if (HELP_1.equalsIgnoreCase(args[i])) {
            arguments.put(HELP_1, "Y"); //$NON-NLS-1$
        } else if (HELP_2.equalsIgnoreCase(args[i])) {
            // put HELP_1 in the map here too - so we only
            // have to check for one entry in the mainline
            arguments.put(HELP_1, "Y"); //$NON-NLS-1$
        } else if (FORCE_JAVA_LOGGING.equalsIgnoreCase(args[i])) {
            LogFactory.forceJavaLogging();
        } else if (CONTEXT_IDS.equalsIgnoreCase(args[i])) {
            if ((i + 1) < args.length) {
                arguments.put(CONTEXT_IDS, args[i + 1]);
            } else {
                errors.add(getString(
                        "RuntimeError.19", CONTEXT_IDS)); //$NON-NLS-1$
            }
            i++;
        } else if (TABLES.equalsIgnoreCase(args[i])) {
            if ((i + 1) < args.length) {
                arguments.put(TABLES, args[i + 1]);
            } else {
                errors.add(getString("RuntimeError.19", TABLES)); //$NON-NLS-1$
            }
            i++;
        } else {
            errors.add(getString("RuntimeError.20", args[i])); //$NON-NLS-1$
        }
    }

    if (!errors.isEmpty()) {
        for (String error : errors) {
            writeLine(error);
        }

        System.exit(-1);
    }

    return arguments;
}
 
Example #4
Source File: ShellRunner.java    From mybatis-generator-plus with Apache License 2.0 4 votes vote down vote up
private static Map<String, String> parseCommandLine(String[] args) {
    List<String> errors = new ArrayList<String>();
    Map<String, String> arguments = new HashMap<String, String>();

    for (int i = 0; i < args.length; i++) {
        if (CONFIG_FILE.equalsIgnoreCase(args[i])) {
            if ((i + 1) < args.length) {
                arguments.put(CONFIG_FILE, args[i + 1]);
            } else {
                errors.add(getString(
                        "RuntimeError.19", CONFIG_FILE)); //$NON-NLS-1$
            }
            i++;
        } else if (OVERWRITE.equalsIgnoreCase(args[i])) {
            arguments.put(OVERWRITE, "Y"); //$NON-NLS-1$
        } else if (VERBOSE.equalsIgnoreCase(args[i])) {
            arguments.put(VERBOSE, "Y"); //$NON-NLS-1$
        } else if (HELP_1.equalsIgnoreCase(args[i])) {
            arguments.put(HELP_1, "Y"); //$NON-NLS-1$
        } else if (HELP_2.equalsIgnoreCase(args[i])) {
            // put HELP_1 in the map here too - so we only
            // have to check for one entry in the mainline
            arguments.put(HELP_1, "Y"); //$NON-NLS-1$
        } else if (FORCE_JAVA_LOGGING.equalsIgnoreCase(args[i])) {
            LogFactory.forceJavaLogging();
        } else if (CONTEXT_IDS.equalsIgnoreCase(args[i])) {
            if ((i + 1) < args.length) {
                arguments.put(CONTEXT_IDS, args[i + 1]);
            } else {
                errors.add(getString(
                        "RuntimeError.19", CONTEXT_IDS)); //$NON-NLS-1$
            }
            i++;
        } else if (TABLES.equalsIgnoreCase(args[i])) {
            if ((i + 1) < args.length) {
                arguments.put(TABLES, args[i + 1]);
            } else {
                errors.add(getString("RuntimeError.19", TABLES)); //$NON-NLS-1$
            }
            i++;
        } else {
            errors.add(getString("RuntimeError.20", args[i])); //$NON-NLS-1$
        }
    }

    if (!errors.isEmpty()) {
        for (String error : errors) {
            writeLine(error);
        }

        System.exit(-1);
    }

    return arguments;
}
 
Example #5
Source File: DatabaseIntrospector.java    From mybatis-generator-core-fix with Apache License 2.0 3 votes vote down vote up
/**
 * Instantiates a new database introspector.
 *
 * @param context
 *            the context
 * @param databaseMetaData
 *            the database meta data
 * @param javaTypeResolver
 *            the java type resolver
 * @param warnings
 *            the warnings
 */
public DatabaseIntrospector(Context context,
        DatabaseMetaData databaseMetaData,
        JavaTypeResolver javaTypeResolver, List<String> warnings) {
    super();
    this.context = context;
    this.databaseMetaData = databaseMetaData;
    this.javaTypeResolver = javaTypeResolver;
    this.warnings = warnings;
    logger = LogFactory.getLog(getClass());
}