本文整理汇总了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);
}
}
}
}
}
示例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());
}
}
}
示例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);
}
}
}
}
}
示例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);
}
}
}
}
}
示例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);
}
}
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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());
}
}
}