Java Code Examples for org.mybatis.generator.config.TableConfiguration#addColumnOverride()

The following examples show how to use org.mybatis.generator.config.TableConfiguration#addColumnOverride() . 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: MyBatisGeneratorConfigurationParser.java    From mapper-generator-javafx with Apache License 2.0 4 votes vote down vote up
private void parseColumnOverride(TableConfiguration tc, Node node) {
    Properties attributes = parseAttributes(node);
    String column = attributes.getProperty("column");

    ColumnOverride co = new ColumnOverride(column);

    String property = attributes.getProperty("property");
    if (stringHasValue(property)) {
        co.setJavaProperty(property);
    }

    String javaType = attributes.getProperty("javaType");
    if (stringHasValue(javaType)) {
        co.setJavaType(javaType);
    }

    String jdbcType = attributes.getProperty("jdbcType");
    if (stringHasValue(jdbcType)) {
        co.setJdbcType(jdbcType);
    }

    String typeHandler = attributes.getProperty("typeHandler");
    if (stringHasValue(typeHandler)) {
        co.setTypeHandler(typeHandler);
    }

    String delimitedColumnName = attributes
            .getProperty("delimitedColumnName");
    if (stringHasValue(delimitedColumnName)) {
        co.setColumnNameDelimited(isTrue(delimitedColumnName));
    }

    String isGeneratedAlways = attributes.getProperty("isGeneratedAlways");
    if (stringHasValue(isGeneratedAlways)) {
        co.setGeneratedAlways(Boolean.parseBoolean(isGeneratedAlways));
    }

    NodeList nodeList = node.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
        Node childNode = nodeList.item(i);

        if (childNode.getNodeType() != Node.ELEMENT_NODE) {
            continue;
        }

        if ("property".equals(childNode.getNodeName())) {
            parseProperty(co, childNode);
        }
    }

    tc.addColumnOverride(co);
}
 
Example 2
Source File: IbatorConfigurationParser.java    From mybatis-generator-core-fix with Apache License 2.0 4 votes vote down vote up
private void parseColumnOverride(TableConfiguration tc, Node node) {
    Properties attributes = parseAttributes(node);
    String column = attributes.getProperty("column"); //$NON-NLS-1$
    String property = attributes.getProperty("property"); //$NON-NLS-1$
    String javaType = attributes.getProperty("javaType"); //$NON-NLS-1$
    String jdbcType = attributes.getProperty("jdbcType"); //$NON-NLS-1$
    String typeHandler = attributes.getProperty("typeHandler"); //$NON-NLS-1$
    String delimitedColumnName = attributes
            .getProperty("delimitedColumnName"); //$NON-NLS-1$

    ColumnOverride co = new ColumnOverride(column);

    if (stringHasValue(property)) {
        co.setJavaProperty(property);
    }

    if (stringHasValue(javaType)) {
        co.setJavaType(javaType);
    }

    if (stringHasValue(jdbcType)) {
        co.setJdbcType(jdbcType);
    }

    if (stringHasValue(typeHandler)) {
        co.setTypeHandler(typeHandler);
    }

    if (stringHasValue(delimitedColumnName)) {
        co.setColumnNameDelimited(isTrue(delimitedColumnName));
    }

    NodeList nodeList = node.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
        Node childNode = nodeList.item(i);

        if (childNode.getNodeType() != Node.ELEMENT_NODE) {
            continue;
        }

        if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$
            parseProperty(co, childNode);
        }
    }

    tc.addColumnOverride(co);
}
 
Example 3
Source File: MyBatisGeneratorConfigurationParser.java    From mybatis-generator-core-fix with Apache License 2.0 4 votes vote down vote up
private void parseColumnOverride(TableConfiguration tc, Node node) {
    Properties attributes = parseAttributes(node);
    String column = attributes.getProperty("column"); //$NON-NLS-1$
    String property = attributes.getProperty("property"); //$NON-NLS-1$
    String javaType = attributes.getProperty("javaType"); //$NON-NLS-1$
    String jdbcType = attributes.getProperty("jdbcType"); //$NON-NLS-1$
    String typeHandler = attributes.getProperty("typeHandler"); //$NON-NLS-1$
    String delimitedColumnName = attributes
            .getProperty("delimitedColumnName"); //$NON-NLS-1$

    ColumnOverride co = new ColumnOverride(column);

    if (stringHasValue(property)) {
        co.setJavaProperty(property);
    }

    if (stringHasValue(javaType)) {
        co.setJavaType(javaType);
    }

    if (stringHasValue(jdbcType)) {
        co.setJdbcType(jdbcType);
    }

    if (stringHasValue(typeHandler)) {
        co.setTypeHandler(typeHandler);
    }

    if (stringHasValue(delimitedColumnName)) {
        co.setColumnNameDelimited(isTrue(delimitedColumnName));
    }

    NodeList nodeList = node.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
        Node childNode = nodeList.item(i);

        if (childNode.getNodeType() != Node.ELEMENT_NODE) {
            continue;
        }

        if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$
            parseProperty(co, childNode);
        }
    }

    tc.addColumnOverride(co);
}
 
Example 4
Source File: IbatorConfigurationParser.java    From mybatis-generator-plus with Apache License 2.0 4 votes vote down vote up
private void parseColumnOverride(TableConfiguration tc, Node node) {
    Properties attributes = parseAttributes(node);
    String column = attributes.getProperty("column"); //$NON-NLS-1$
    String property = attributes.getProperty("property"); //$NON-NLS-1$
    String javaType = attributes.getProperty("javaType"); //$NON-NLS-1$
    String jdbcType = attributes.getProperty("jdbcType"); //$NON-NLS-1$
    String typeHandler = attributes.getProperty("typeHandler"); //$NON-NLS-1$
    String delimitedColumnName = attributes
            .getProperty("delimitedColumnName"); //$NON-NLS-1$

    ColumnOverride co = new ColumnOverride(column);

    if (stringHasValue(property)) {
        co.setJavaProperty(property);
    }

    if (stringHasValue(javaType)) {
        co.setJavaType(javaType);
    }

    if (stringHasValue(jdbcType)) {
        co.setJdbcType(jdbcType);
    }

    if (stringHasValue(typeHandler)) {
        co.setTypeHandler(typeHandler);
    }

    if (stringHasValue(delimitedColumnName)) {
        co.setColumnNameDelimited(isTrue(delimitedColumnName));
    }

    NodeList nodeList = node.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
        Node childNode = nodeList.item(i);

        if (childNode.getNodeType() != Node.ELEMENT_NODE) {
            continue;
        }

        if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$
            parseProperty(co, childNode);
        }
    }

    tc.addColumnOverride(co);
}
 
Example 5
Source File: MyBatisGeneratorConfigurationParser.java    From mybatis-generator-plus with Apache License 2.0 4 votes vote down vote up
private void parseColumnOverride(TableConfiguration tc, Node node) {
    Properties attributes = parseAttributes(node);
    String column = attributes.getProperty("column"); //$NON-NLS-1$
    String property = attributes.getProperty("property"); //$NON-NLS-1$
    String javaType = attributes.getProperty("javaType"); //$NON-NLS-1$
    String jdbcType = attributes.getProperty("jdbcType"); //$NON-NLS-1$
    String typeHandler = attributes.getProperty("typeHandler"); //$NON-NLS-1$
    String delimitedColumnName = attributes
            .getProperty("delimitedColumnName"); //$NON-NLS-1$

    ColumnOverride co = new ColumnOverride(column);

    if (stringHasValue(property)) {
        co.setJavaProperty(property);
    }

    if (stringHasValue(javaType)) {
        co.setJavaType(javaType);
    }

    if (stringHasValue(jdbcType)) {
        co.setJdbcType(jdbcType);
    }

    if (stringHasValue(typeHandler)) {
        co.setTypeHandler(typeHandler);
    }

    if (stringHasValue(delimitedColumnName)) {
        co.setColumnNameDelimited(isTrue(delimitedColumnName));
    }

    NodeList nodeList = node.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
        Node childNode = nodeList.item(i);

        if (childNode.getNodeType() != Node.ELEMENT_NODE) {
            continue;
        }

        if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$
            parseProperty(co, childNode);
        }
    }

    tc.addColumnOverride(co);
}