Examples of TableConfiguration


Examples of org.mybatis.generator.config.TableConfiguration

      }
    }
  }

  private void parseTable(Context context, Node node) {
    TableConfiguration tc = new TableConfiguration(context);
    context.addTableConfiguration(tc);

    Properties attributes = parseAttributes(node);
    String catalog = attributes.getProperty("catalog"); //$NON-NLS-1$
    String schema = attributes.getProperty("schema"); //$NON-NLS-1$
    String tableName = attributes.getProperty("tableName"); //$NON-NLS-1$
    String domainObjectName = attributes.getProperty("domainObjectName"); //$NON-NLS-1$
    String alias = attributes.getProperty("alias"); //$NON-NLS-1$
    String enableInsert = attributes.getProperty("enableInsert"); //$NON-NLS-1$
    String enableSelectByPrimaryKey = attributes.getProperty("enableSelectByPrimaryKey"); //$NON-NLS-1$
    String enableSelectByExample = attributes.getProperty("enableSelectByExample"); //$NON-NLS-1$
    String enableUpdateByPrimaryKey = attributes.getProperty("enableUpdateByPrimaryKey"); //$NON-NLS-1$
    String enableDeleteByPrimaryKey = attributes.getProperty("enableDeleteByPrimaryKey"); //$NON-NLS-1$
    String enableDeleteByExample = attributes.getProperty("enableDeleteByExample"); //$NON-NLS-1$
    String enableCountByExample = attributes.getProperty("enableCountByExample"); //$NON-NLS-1$
    String enableUpdateByExample = attributes.getProperty("enableUpdateByExample"); //$NON-NLS-1$
    String selectByPrimaryKeyQueryId = attributes.getProperty("selectByPrimaryKeyQueryId"); //$NON-NLS-1$
    String selectByExampleQueryId = attributes.getProperty("selectByExampleQueryId"); //$NON-NLS-1$
    String modelType = attributes.getProperty("modelType"); //$NON-NLS-1$
    String escapeWildcards = attributes.getProperty("escapeWildcards"); //$NON-NLS-1$
    String delimitIdentifiers = attributes.getProperty("delimitIdentifiers"); //$NON-NLS-1$
    String delimitAllColumns = attributes.getProperty("delimitAllColumns"); //$NON-NLS-1$

    if (stringHasValue(catalog)) {
      tc.setCatalog(catalog);
    }

    if (stringHasValue(schema)) {
      tc.setSchema(schema);
    }

    if (stringHasValue(tableName)) {
      tc.setTableName(tableName);
    }

    if (stringHasValue(domainObjectName)) {
      tc.setDomainObjectName(domainObjectName);
    }

    if (stringHasValue(alias)) {
      tc.setAlias(alias);
    }

    if (stringHasValue(enableInsert)) {
      tc.setInsertStatementEnabled(isTrue(enableInsert));
    }

    if (stringHasValue(enableSelectByPrimaryKey)) {
      tc.setSelectByPrimaryKeyStatementEnabled(isTrue(enableSelectByPrimaryKey));
    }

    if (stringHasValue(enableSelectByExample)) {
      tc.setSelectByExampleStatementEnabled(isTrue(enableSelectByExample));
    }

    if (stringHasValue(enableUpdateByPrimaryKey)) {
      tc.setUpdateByPrimaryKeyStatementEnabled(isTrue(enableUpdateByPrimaryKey));
    }

    if (stringHasValue(enableDeleteByPrimaryKey)) {
      tc.setDeleteByPrimaryKeyStatementEnabled(isTrue(enableDeleteByPrimaryKey));
    }

    if (stringHasValue(enableDeleteByExample)) {
      tc.setDeleteByExampleStatementEnabled(isTrue(enableDeleteByExample));
    }

    if (stringHasValue(enableCountByExample)) {
      tc.setCountByExampleStatementEnabled(isTrue(enableCountByExample));
    }

    if (stringHasValue(enableUpdateByExample)) {
      tc.setUpdateByExampleStatementEnabled(isTrue(enableUpdateByExample));
    }

    if (stringHasValue(selectByPrimaryKeyQueryId)) {
      tc.setSelectByPrimaryKeyQueryId(selectByPrimaryKeyQueryId);
    }

    if (stringHasValue(selectByExampleQueryId)) {
      tc.setSelectByExampleQueryId(selectByExampleQueryId);
    }

    if (stringHasValue(modelType)) {
      tc.setConfiguredModelType(modelType);
    }

    if (stringHasValue(escapeWildcards)) {
      tc.setWildcardEscapingEnabled(isTrue(escapeWildcards));
    }

    if (stringHasValue(delimitIdentifiers)) {
      tc.setDelimitIdentifiers(isTrue(delimitIdentifiers));
    }

    if (stringHasValue(delimitAllColumns)) {
      tc.setAllColumnDelimitingEnabled(isTrue(delimitAllColumns));
    }

    NodeList nodeList = node.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
      Node childNode = nodeList.item(i);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.