本文整理汇总了Java中org.mybatis.generator.api.IntrospectedColumn.isJDBCDateColumn方法的典型用法代码示例。如果您正苦于以下问题:Java IntrospectedColumn.isJDBCDateColumn方法的具体用法?Java IntrospectedColumn.isJDBCDateColumn怎么用?Java IntrospectedColumn.isJDBCDateColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.mybatis.generator.api.IntrospectedColumn
的用法示例。
在下文中一共展示了IntrospectedColumn.isJDBCDateColumn方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSingleValueMethod
import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
private Method getSingleValueMethod(IntrospectedColumn introspectedColumn,
String nameFragment, String operator) {
Method method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
method.addParameter(new Parameter(introspectedColumn
.getFullyQualifiedJavaType(), "value")); //$NON-NLS-1$
StringBuilder sb = new StringBuilder();
sb.append(introspectedColumn.getJavaProperty());
sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
sb.insert(0, "and"); //$NON-NLS-1$
sb.append(nameFragment);
method.setName(sb.toString());
method.setReturnType(FullyQualifiedJavaType.getCriteriaInstance());
sb.setLength(0);
if (introspectedColumn.isJDBCDateColumn()) {
sb.append("addCriterionForJDBCDate(\""); //$NON-NLS-1$
} else if (introspectedColumn.isJDBCTimeColumn()) {
sb.append("addCriterionForJDBCTime(\""); //$NON-NLS-1$
} else if (stringHasValue(introspectedColumn
.getTypeHandler())) {
sb.append("add"); //$NON-NLS-1$
sb.append(introspectedColumn.getJavaProperty());
sb.setCharAt(3, Character.toUpperCase(sb.charAt(3)));
sb.append("Criterion(\""); //$NON-NLS-1$
} else {
sb.append("addCriterion(\""); //$NON-NLS-1$
}
sb.append(Ibatis2FormattingUtilities
.getAliasedActualColumnName(introspectedColumn));
sb.append(' ');
sb.append(operator);
sb.append("\", "); //$NON-NLS-1$
if (introspectedColumn.getFullyQualifiedJavaType().isPrimitive() && !introspectedTable.isJava5Targeted()) {
sb.append("new "); //$NON-NLS-1$
sb.append(introspectedColumn.getFullyQualifiedJavaType()
.getPrimitiveTypeWrapper().getShortName());
sb.append("(value)"); //$NON-NLS-1$
} else {
sb.append("value"); //$NON-NLS-1$
}
sb.append(", \""); //$NON-NLS-1$
sb.append(introspectedColumn.getJavaProperty());
sb.append("\");"); //$NON-NLS-1$
method.addBodyLine(sb.toString());
method.addBodyLine("return (Criteria) this;"); //$NON-NLS-1$
return method;
}
示例2: getSetBetweenOrNotBetweenMethod
import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
/**
* Generates methods that set between and not between conditions
*
* @param introspectedColumn
* @param betweenMethod
* @return a generated method for the between or not between method
*/
private Method getSetBetweenOrNotBetweenMethod(
IntrospectedColumn introspectedColumn, boolean betweenMethod) {
Method method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
FullyQualifiedJavaType type = introspectedColumn
.getFullyQualifiedJavaType();
method.addParameter(new Parameter(type, "value1")); //$NON-NLS-1$
method.addParameter(new Parameter(type, "value2")); //$NON-NLS-1$
StringBuilder sb = new StringBuilder();
sb.append(introspectedColumn.getJavaProperty());
sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
sb.insert(0, "and"); //$NON-NLS-1$
if (betweenMethod) {
sb.append("Between"); //$NON-NLS-1$
} else {
sb.append("NotBetween"); //$NON-NLS-1$
}
method.setName(sb.toString());
method.setReturnType(FullyQualifiedJavaType.getCriteriaInstance());
sb.setLength(0);
if (introspectedColumn.isJDBCDateColumn()) {
sb.append("addCriterionForJDBCDate(\""); //$NON-NLS-1$
} else if (introspectedColumn.isJDBCTimeColumn()) {
sb.append("addCriterionForJDBCTime(\""); //$NON-NLS-1$
} else if (stringHasValue(introspectedColumn
.getTypeHandler())) {
sb.append("add"); //$NON-NLS-1$
sb.append(introspectedColumn.getJavaProperty());
sb.setCharAt(3, Character.toUpperCase(sb.charAt(3)));
sb.append("Criterion(\""); //$NON-NLS-1$
} else {
sb.append("addCriterion(\""); //$NON-NLS-1$
}
sb.append(Ibatis2FormattingUtilities
.getAliasedActualColumnName(introspectedColumn));
if (betweenMethod) {
sb.append(" between"); //$NON-NLS-1$
} else {
sb.append(" not between"); //$NON-NLS-1$
}
sb.append("\", "); //$NON-NLS-1$
if (introspectedColumn.getFullyQualifiedJavaType().isPrimitive() && !introspectedTable.isJava5Targeted()) {
sb.append("new "); //$NON-NLS-1$
sb.append(introspectedColumn.getFullyQualifiedJavaType()
.getPrimitiveTypeWrapper().getShortName());
sb.append("(value1), "); //$NON-NLS-1$
sb.append("new "); //$NON-NLS-1$
sb.append(introspectedColumn.getFullyQualifiedJavaType()
.getPrimitiveTypeWrapper().getShortName());
sb.append("(value2)"); //$NON-NLS-1$
} else {
sb.append("value1, value2"); //$NON-NLS-1$
}
sb.append(", \""); //$NON-NLS-1$
sb.append(introspectedColumn.getJavaProperty());
sb.append("\");"); //$NON-NLS-1$
method.addBodyLine(sb.toString());
method.addBodyLine("return (Criteria) this;"); //$NON-NLS-1$
return method;
}
示例3: getSetInOrNotInMethod
import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
/**
*
* @param introspectedColumn
* @param inMethod
* if true generates an "in" method, else generates a "not in"
* method
* @return a generated method for the in or not in method
*/
private Method getSetInOrNotInMethod(IntrospectedColumn introspectedColumn,
boolean inMethod) {
Method method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
FullyQualifiedJavaType type = FullyQualifiedJavaType
.getNewListInstance();
if (generateForJava5) {
if (introspectedColumn.getFullyQualifiedJavaType().isPrimitive()) {
type.addTypeArgument(introspectedColumn
.getFullyQualifiedJavaType().getPrimitiveTypeWrapper());
} else {
type.addTypeArgument(introspectedColumn
.getFullyQualifiedJavaType());
}
}
method.addParameter(new Parameter(type, "values")); //$NON-NLS-1$
StringBuilder sb = new StringBuilder();
sb.append(introspectedColumn.getJavaProperty());
sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
sb.insert(0, "and"); //$NON-NLS-1$
if (inMethod) {
sb.append("In"); //$NON-NLS-1$
} else {
sb.append("NotIn"); //$NON-NLS-1$
}
method.setName(sb.toString());
method.setReturnType(FullyQualifiedJavaType.getCriteriaInstance());
sb.setLength(0);
if (introspectedColumn.isJDBCDateColumn()) {
sb.append("addCriterionForJDBCDate(\""); //$NON-NLS-1$
} else if (introspectedColumn.isJDBCTimeColumn()) {
sb.append("addCriterionForJDBCTime(\""); //$NON-NLS-1$
} else if (stringHasValue(introspectedColumn
.getTypeHandler())) {
sb.append("add"); //$NON-NLS-1$
sb.append(introspectedColumn.getJavaProperty());
sb.setCharAt(3, Character.toUpperCase(sb.charAt(3)));
sb.append("Criterion(\""); //$NON-NLS-1$
} else {
sb.append("addCriterion(\""); //$NON-NLS-1$
}
sb.append(Ibatis2FormattingUtilities
.getAliasedActualColumnName(introspectedColumn));
if (inMethod) {
sb.append(" in"); //$NON-NLS-1$
} else {
sb.append(" not in"); //$NON-NLS-1$
}
sb.append("\", values, \""); //$NON-NLS-1$
sb.append(introspectedColumn.getJavaProperty());
sb.append("\");"); //$NON-NLS-1$
method.addBodyLine(sb.toString());
method.addBodyLine("return (Criteria) this;"); //$NON-NLS-1$
return method;
}
示例4: getSingleValueMethod
import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
private Method getSingleValueMethod(IntrospectedColumn introspectedColumn,
String nameFragment, String operator) {
Method method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
method.addParameter(new Parameter(introspectedColumn
.getFullyQualifiedJavaType(), "value")); //$NON-NLS-1$
StringBuilder sb = new StringBuilder();
sb.append(introspectedColumn.getJavaProperty());
sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
sb.insert(0, "and"); //$NON-NLS-1$
sb.append(nameFragment);
method.setName(sb.toString());
method.setReturnType(FullyQualifiedJavaType.getCriteriaInstance());
sb.setLength(0);
if (introspectedColumn.isJDBCDateColumn()) {
sb.append("addCriterionForJDBCDate(\""); //$NON-NLS-1$
} else if (introspectedColumn.isJDBCTimeColumn()) {
sb.append("addCriterionForJDBCTime(\""); //$NON-NLS-1$
} else if (stringHasValue(introspectedColumn
.getTypeHandler())) {
sb.append("add"); //$NON-NLS-1$
sb.append(introspectedColumn.getJavaProperty());
sb.setCharAt(3, Character.toUpperCase(sb.charAt(3)));
sb.append("Criterion(\""); //$NON-NLS-1$
} else {
sb.append("addCriterion(\""); //$NON-NLS-1$
}
sb.append(MyBatis3FormattingUtilities
.getAliasedActualColumnName(introspectedColumn));
sb.append(' ');
sb.append(operator);
sb.append("\", "); //$NON-NLS-1$
sb.append("value"); //$NON-NLS-1$
sb.append(", \""); //$NON-NLS-1$
sb.append(introspectedColumn.getJavaProperty());
sb.append("\");"); //$NON-NLS-1$
method.addBodyLine(sb.toString());
method.addBodyLine("return (Criteria) this;"); //$NON-NLS-1$
return method;
}
示例5: getSetBetweenOrNotBetweenMethod
import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
/**
* Generates methods that set between and not between conditions
*
* @param introspectedColumn
* @param betweenMethod
* @return a generated method for the between or not between method
*/
private Method getSetBetweenOrNotBetweenMethod(
IntrospectedColumn introspectedColumn, boolean betweenMethod) {
Method method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
FullyQualifiedJavaType type = introspectedColumn
.getFullyQualifiedJavaType();
method.addParameter(new Parameter(type, "value1")); //$NON-NLS-1$
method.addParameter(new Parameter(type, "value2")); //$NON-NLS-1$
StringBuilder sb = new StringBuilder();
sb.append(introspectedColumn.getJavaProperty());
sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
sb.insert(0, "and"); //$NON-NLS-1$
if (betweenMethod) {
sb.append("Between"); //$NON-NLS-1$
} else {
sb.append("NotBetween"); //$NON-NLS-1$
}
method.setName(sb.toString());
method.setReturnType(FullyQualifiedJavaType.getCriteriaInstance());
sb.setLength(0);
if (introspectedColumn.isJDBCDateColumn()) {
sb.append("addCriterionForJDBCDate(\""); //$NON-NLS-1$
} else if (introspectedColumn.isJDBCTimeColumn()) {
sb.append("addCriterionForJDBCTime(\""); //$NON-NLS-1$
} else if (stringHasValue(introspectedColumn
.getTypeHandler())) {
sb.append("add"); //$NON-NLS-1$
sb.append(introspectedColumn.getJavaProperty());
sb.setCharAt(3, Character.toUpperCase(sb.charAt(3)));
sb.append("Criterion(\""); //$NON-NLS-1$
} else {
sb.append("addCriterion(\""); //$NON-NLS-1$
}
sb.append(MyBatis3FormattingUtilities
.getAliasedActualColumnName(introspectedColumn));
if (betweenMethod) {
sb.append(" between"); //$NON-NLS-1$
} else {
sb.append(" not between"); //$NON-NLS-1$
}
sb.append("\", "); //$NON-NLS-1$
sb.append("value1, value2"); //$NON-NLS-1$
sb.append(", \""); //$NON-NLS-1$
sb.append(introspectedColumn.getJavaProperty());
sb.append("\");"); //$NON-NLS-1$
method.addBodyLine(sb.toString());
method.addBodyLine("return (Criteria) this;"); //$NON-NLS-1$
return method;
}
示例6: getSetInOrNotInMethod
import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
/**
*
* @param introspectedColumn
* @param inMethod
* if true generates an "in" method, else generates a "not in"
* method
* @return a generated method for the in or not in method
*/
private Method getSetInOrNotInMethod(IntrospectedColumn introspectedColumn,
boolean inMethod) {
Method method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
FullyQualifiedJavaType type = FullyQualifiedJavaType
.getNewListInstance();
if (introspectedColumn.getFullyQualifiedJavaType().isPrimitive()) {
type.addTypeArgument(introspectedColumn.getFullyQualifiedJavaType()
.getPrimitiveTypeWrapper());
} else {
type
.addTypeArgument(introspectedColumn
.getFullyQualifiedJavaType());
}
method.addParameter(new Parameter(type, "values")); //$NON-NLS-1$
StringBuilder sb = new StringBuilder();
sb.append(introspectedColumn.getJavaProperty());
sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
sb.insert(0, "and"); //$NON-NLS-1$
if (inMethod) {
sb.append("In"); //$NON-NLS-1$
} else {
sb.append("NotIn"); //$NON-NLS-1$
}
method.setName(sb.toString());
method.setReturnType(FullyQualifiedJavaType.getCriteriaInstance());
sb.setLength(0);
if (introspectedColumn.isJDBCDateColumn()) {
sb.append("addCriterionForJDBCDate(\""); //$NON-NLS-1$
} else if (introspectedColumn.isJDBCTimeColumn()) {
sb.append("addCriterionForJDBCTime(\""); //$NON-NLS-1$
} else if (stringHasValue(introspectedColumn
.getTypeHandler())) {
sb.append("add"); //$NON-NLS-1$
sb.append(introspectedColumn.getJavaProperty());
sb.setCharAt(3, Character.toUpperCase(sb.charAt(3)));
sb.append("Criterion(\""); //$NON-NLS-1$
} else {
sb.append("addCriterion(\""); //$NON-NLS-1$
}
sb.append(MyBatis3FormattingUtilities
.getAliasedActualColumnName(introspectedColumn));
if (inMethod) {
sb.append(" in"); //$NON-NLS-1$
} else {
sb.append(" not in"); //$NON-NLS-1$
}
sb.append("\", values, \""); //$NON-NLS-1$
sb.append(introspectedColumn.getJavaProperty());
sb.append("\");"); //$NON-NLS-1$
method.addBodyLine(sb.toString());
method.addBodyLine("return (Criteria) this;"); //$NON-NLS-1$
return method;
}