本文整理汇总了Java中org.mybatis.generator.api.DAOMethodNameCalculator类的典型用法代码示例。如果您正苦于以下问题:Java DAOMethodNameCalculator类的具体用法?Java DAOMethodNameCalculator怎么用?Java DAOMethodNameCalculator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DAOMethodNameCalculator类属于org.mybatis.generator.api包,在下文中一共展示了DAOMethodNameCalculator类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMethodShell
import org.mybatis.generator.api.DAOMethodNameCalculator; //导入依赖的package包/类
private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
Method method = new Method();
FullyQualifiedJavaType returnType;
if (introspectedTable.getGeneratedKey() != null) {
IntrospectedColumn introspectedColumn = introspectedTable.getColumn(introspectedTable.getGeneratedKey()
.getColumn());
if (introspectedColumn == null) {
// the specified column doesn't exist, so don't do the generated
// key
// (the warning has already been reported)
returnType = null;
} else {
returnType = introspectedColumn.getFullyQualifiedJavaType();
importedTypes.add(returnType);
}
} else {
returnType = null;
}
method.setReturnType(returnType);
method.setVisibility(JavaVisibility.PUBLIC);
DAOMethodNameCalculator methodNameCalculator = getDAOMethodNameCalculator();
method.setName(methodNameCalculator.getInsertMethodName(introspectedTable));
FullyQualifiedJavaType parameterType = introspectedTable.getRules().calculateAllFieldsClass();
importedTypes.add(parameterType);
method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$
for (FullyQualifiedJavaType fqjt : daoTemplate.getCheckedExceptions()) {
method.addException(fqjt);
importedTypes.add(fqjt);
}
context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable);
return method;
}
示例2: getMethodShell
import org.mybatis.generator.api.DAOMethodNameCalculator; //导入依赖的package包/类
private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
Method method = new Method();
FullyQualifiedJavaType returnType;
if (introspectedTable.getGeneratedKey() != null) {
IntrospectedColumn introspectedColumn = introspectedTable
.getColumn(introspectedTable.getGeneratedKey().getColumn());
if (introspectedColumn == null) {
// the specified column doesn't exist, so don't do the generated
// key
// (the warning has already been reported)
returnType = null;
} else {
returnType = introspectedColumn.getFullyQualifiedJavaType();
importedTypes.add(returnType);
}
} else {
returnType = null;
}
method.setReturnType(returnType);
method.setVisibility(JavaVisibility.PUBLIC);
DAOMethodNameCalculator methodNameCalculator = getDAOMethodNameCalculator();
method.setName(methodNameCalculator
.getInsertMethodName(introspectedTable));
FullyQualifiedJavaType parameterType = introspectedTable.getRules()
.calculateAllFieldsClass();
importedTypes.add(parameterType);
method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$
for (FullyQualifiedJavaType fqjt : daoTemplate.getCheckedExceptions()) {
method.addException(fqjt);
importedTypes.add(fqjt);
}
context.getCommentGenerator().addGeneralMethodComment(method,
introspectedTable);
return method;
}