当前位置: 首页>>代码示例>>Java>>正文


Java GeneratedKey.isJdbcStandard方法代码示例

本文整理汇总了Java中org.mybatis.generator.config.GeneratedKey.isJdbcStandard方法的典型用法代码示例。如果您正苦于以下问题:Java GeneratedKey.isJdbcStandard方法的具体用法?Java GeneratedKey.isJdbcStandard怎么用?Java GeneratedKey.isJdbcStandard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.mybatis.generator.config.GeneratedKey的用法示例。


在下文中一共展示了GeneratedKey.isJdbcStandard方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: calculateIdentityColumns

import org.mybatis.generator.config.GeneratedKey; //导入方法依赖的package包/类
/**
 * Calculate identity columns.
 *
 * @param tc
 *            the tc
 * @param columns
 *            the columns
 */
private void calculateIdentityColumns(TableConfiguration tc,
        Map<ActualTableName, List<IntrospectedColumn>> columns) {
    GeneratedKey gk = tc.getGeneratedKey();
    if (gk == null) {
        // no generated key, then no identity or sequence columns
        return;
    }
    
    for (Map.Entry<ActualTableName, List<IntrospectedColumn>> entry : columns
            .entrySet()) {
        for (IntrospectedColumn introspectedColumn : entry.getValue()) {
            if (isMatchedColumn(introspectedColumn, gk)) {
                if (gk.isIdentity() || gk.isJdbcStandard()) {
                    introspectedColumn.setIdentity(true);
                    introspectedColumn.setSequenceColumn(false);
                } else {
                    introspectedColumn.setIdentity(false);
                    introspectedColumn.setSequenceColumn(true);
                }
            }
        }
    }
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:32,代码来源:DatabaseIntrospector.java

示例2: addGeneratedKeyAnnotation

import org.mybatis.generator.config.GeneratedKey; //导入方法依赖的package包/类
protected void addGeneratedKeyAnnotation(Method method, GeneratedKey gk) {
    StringBuilder sb = new StringBuilder();
    IntrospectedColumn introspectedColumn = introspectedTable.getColumn(gk.getColumn());
    if (introspectedColumn != null) {
        if (gk.isJdbcStandard()) {
            sb.append("@Options(useGeneratedKeys=true,keyProperty=\""); //$NON-NLS-1$
            sb.append(introspectedColumn.getJavaProperty());
            sb.append("\")"); //$NON-NLS-1$
            method.addAnnotation(sb.toString());
        } else {
            FullyQualifiedJavaType fqjt = introspectedColumn.getFullyQualifiedJavaType();
            sb.append("@SelectKey(statement=\""); //$NON-NLS-1$
            sb.append(gk.getRuntimeSqlStatement());
            sb.append("\", keyProperty=\""); //$NON-NLS-1$
            sb.append(introspectedColumn.getJavaProperty());
            sb.append("\", before="); //$NON-NLS-1$
            sb.append(gk.isIdentity() ? "false" : "true"); //$NON-NLS-1$ //$NON-NLS-2$
            sb.append(", resultType="); //$NON-NLS-1$
            sb.append(fqjt.getShortName());
            sb.append(".class)"); //$NON-NLS-1$
            method.addAnnotation(sb.toString());
        }
    }
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:25,代码来源:AbstractJavaMapperMethodGenerator.java

示例3: calculateIdentityColumns

import org.mybatis.generator.config.GeneratedKey; //导入方法依赖的package包/类
private void calculateIdentityColumns(TableConfiguration tc, Map<ActualTableName, List<IntrospectedColumn>> columns) {
    GeneratedKey gk = tc.getGeneratedKey();
    if (gk == null) {
        // no generated key, then no identity or sequence columns
        return;
    }

    for (Map.Entry<ActualTableName, List<IntrospectedColumn>> entry : columns.entrySet()) {
        for (IntrospectedColumn introspectedColumn : entry.getValue()) {
            if (isMatchedColumn(introspectedColumn, gk)) {
                if (gk.isIdentity() || gk.isJdbcStandard()) {
                    introspectedColumn.setIdentity(true);
                    introspectedColumn.setSequenceColumn(false);
                } else {
                    introspectedColumn.setIdentity(false);
                    introspectedColumn.setSequenceColumn(true);
                }
            }
        }
    }
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:22,代码来源:DatabaseIntrospector.java

示例4: calculateIdentityColumns

import org.mybatis.generator.config.GeneratedKey; //导入方法依赖的package包/类
private void calculateIdentityColumns(TableConfiguration tc,
        Map<ActualTableName, List<IntrospectedColumn>> columns) {
    GeneratedKey gk = tc.getGeneratedKey();
    if (gk == null) {
        // no generated key, then no identity or sequence columns
        return;
    }
    
    for (Map.Entry<ActualTableName, List<IntrospectedColumn>> entry : columns
            .entrySet()) {
        for (IntrospectedColumn introspectedColumn : entry.getValue()) {
            if (isMatchedColumn(introspectedColumn, gk)) {
                if (gk.isIdentity() || gk.isJdbcStandard()) {
                    introspectedColumn.setIdentity(true);
                    introspectedColumn.setSequenceColumn(false);
                } else {
                    introspectedColumn.setIdentity(false);
                    introspectedColumn.setSequenceColumn(true);
                }
            }
        }
    }
}
 
开发者ID:handosme,项目名称:mybatis-generator-plus,代码行数:24,代码来源:DatabaseIntrospector.java

示例5: calculateIdentityColumns

import org.mybatis.generator.config.GeneratedKey; //导入方法依赖的package包/类
private void calculateIdentityColumns(TableConfiguration tc, Map<ActualTableName, List<IntrospectedColumn>> columns) {
	GeneratedKey gk = tc.getGeneratedKey();
	if (gk == null) {
		// no generated key, then no identity or sequence columns
		return;
	}

	for (Map.Entry<ActualTableName, List<IntrospectedColumn>> entry : columns.entrySet()) {
		for (IntrospectedColumn introspectedColumn : entry.getValue()) {
			if (isMatchedColumn(introspectedColumn, gk)) {
				if (gk.isIdentity() || gk.isJdbcStandard()) {
					introspectedColumn.setIdentity(true);
					introspectedColumn.setSequenceColumn(false);
				} else {
					introspectedColumn.setIdentity(false);
					introspectedColumn.setSequenceColumn(true);
				}
			}
		}
	}
}
 
开发者ID:fnyexx,项目名称:mybator,代码行数:22,代码来源:DatabaseIntrospector.java

示例6: addGeneratedKeyImports

import org.mybatis.generator.config.GeneratedKey; //导入方法依赖的package包/类
protected void addGeneratedKeyImports(Interface interfaze, GeneratedKey gk) {
    IntrospectedColumn introspectedColumn = introspectedTable.getColumn(gk.getColumn());
    if (introspectedColumn != null) {
        if (gk.isJdbcStandard()) {
            interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Options")); //$NON-NLS-1$
        } else {
            interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.SelectKey")); //$NON-NLS-1$
            FullyQualifiedJavaType fqjt = introspectedColumn.getFullyQualifiedJavaType();
            interfaze.addImportedType(fqjt);
        }
    }
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:13,代码来源:AbstractJavaMapperMethodGenerator.java

示例7: addGeneratedKeyAnnotation

import org.mybatis.generator.config.GeneratedKey; //导入方法依赖的package包/类
protected void addGeneratedKeyAnnotation(Interface interfaze, Method method,
        GeneratedKey gk) {
    StringBuilder sb = new StringBuilder();
    IntrospectedColumn introspectedColumn = introspectedTable.getColumn(gk.getColumn());
    if (introspectedColumn != null) {
        if (gk.isJdbcStandard()) {
            interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Options")); //$NON-NLS-1$
            sb.append("@Options(useGeneratedKeys=true,keyProperty=\""); //$NON-NLS-1$
            sb.append(introspectedColumn.getJavaProperty());
            sb.append("\")"); //$NON-NLS-1$
            method.addAnnotation(sb.toString());
        } else {
            interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.SelectKey")); //$NON-NLS-1$
            FullyQualifiedJavaType fqjt = introspectedColumn.getFullyQualifiedJavaType();
            interfaze.addImportedType(fqjt);
            sb.append("@SelectKey(statement=\""); //$NON-NLS-1$
            sb.append(gk.getRuntimeSqlStatement());
            sb.append("\", keyProperty=\""); //$NON-NLS-1$
            sb.append(introspectedColumn.getJavaProperty());
            sb.append("\", before="); //$NON-NLS-1$
            sb.append(gk.isIdentity() ? "false" : "true"); //$NON-NLS-1$ //$NON-NLS-2$
            sb.append(", resultType="); //$NON-NLS-1$
            sb.append(fqjt.getShortName());
            sb.append(".class)"); //$NON-NLS-1$
            method.addAnnotation(sb.toString());
        }
    }
}
 
开发者ID:xiachengwei5,项目名称:org.mybatis.generator.core-1.3.5,代码行数:29,代码来源:AbstractJavaMapperMethodGenerator.java

示例8: addGeneratedKeyImports

import org.mybatis.generator.config.GeneratedKey; //导入方法依赖的package包/类
protected void addGeneratedKeyImports(Interface interfaze, GeneratedKey gk) {
    IntrospectedColumn introspectedColumn = introspectedTable.getColumn(gk.getColumn());
    if (introspectedColumn != null) {
        if (gk.isJdbcStandard()) {
            interfaze.addImportedType(
                    new FullyQualifiedJavaType("org.apache.ibatis.annotations.Options")); //$NON-NLS-1$
        } else {
            interfaze.addImportedType(
                    new FullyQualifiedJavaType("org.apache.ibatis.annotations.SelectKey")); //$NON-NLS-1$
            FullyQualifiedJavaType fqjt = introspectedColumn.getFullyQualifiedJavaType();
            interfaze.addImportedType(fqjt);
        }
    }
}
 
开发者ID:nextyu,项目名称:summer-mybatis-generator,代码行数:15,代码来源:AbstractJavaMapperMethodGenerator.java

示例9: addGeneratedKeyAnnotation

import org.mybatis.generator.config.GeneratedKey; //导入方法依赖的package包/类
protected void addGeneratedKeyAnnotation(Interface interfaze, Method method, GeneratedKey gk) {
	StringBuilder sb = new StringBuilder();
	IntrospectedColumn introspectedColumn = introspectedTable.getColumn(gk.getColumn());
	if (introspectedColumn != null) {
		if (gk.isJdbcStandard()) {
			interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Options")); //$NON-NLS-1$
			sb.append("@Options(useGeneratedKeys=true,keyProperty=\""); //$NON-NLS-1$
			sb.append(introspectedColumn.getJavaProperty());
			sb.append("\")"); //$NON-NLS-1$
			method.addAnnotation(sb.toString());
		} else {
			interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.SelectKey")); //$NON-NLS-1$
			FullyQualifiedJavaType fqjt = introspectedColumn.getFullyQualifiedJavaType();
			interfaze.addImportedType(fqjt);
			sb.append("@SelectKey(statement=\""); //$NON-NLS-1$
			sb.append(gk.getRuntimeSqlStatement());
			sb.append("\", keyProperty=\""); //$NON-NLS-1$
			sb.append(introspectedColumn.getJavaProperty());
			sb.append("\", before="); //$NON-NLS-1$
			sb.append(gk.isIdentity() ? "false" : "true"); //$NON-NLS-1$ //$NON-NLS-2$
			sb.append(", resultType="); //$NON-NLS-1$
			sb.append(fqjt.getShortName());
			sb.append(".class)"); //$NON-NLS-1$
			method.addAnnotation(sb.toString());
		}
	}
}
 
开发者ID:fnyexx,项目名称:mybator,代码行数:28,代码来源:AbstractJavaMapperMethodGenerator.java


注:本文中的org.mybatis.generator.config.GeneratedKey.isJdbcStandard方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。