本文整理汇总了Java中org.mybatis.generator.codegen.mybatis3.MyBatis3FormattingUtilities.getAliasedEscapedColumnName方法的典型用法代码示例。如果您正苦于以下问题:Java MyBatis3FormattingUtilities.getAliasedEscapedColumnName方法的具体用法?Java MyBatis3FormattingUtilities.getAliasedEscapedColumnName怎么用?Java MyBatis3FormattingUtilities.getAliasedEscapedColumnName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.mybatis.generator.codegen.mybatis3.MyBatis3FormattingUtilities
的用法示例。
在下文中一共展示了MyBatis3FormattingUtilities.getAliasedEscapedColumnName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateCopyForSetByPrefix
import org.mybatis.generator.codegen.mybatis3.MyBatis3FormattingUtilities; //导入方法依赖的package包/类
protected void generateCopyForSetByPrefix(String fieldPrefix, String leftPrefix, String rightPrefix, boolean ifNullCheck, IntrospectedTable introspectedTable, XmlElement dynamicElement) {
XmlElement trimElement = new XmlElement("trim");
trimElement.addAttribute(new Attribute("suffixOverrides", ","));
StringBuilder sb = new StringBuilder();
for (IntrospectedColumn introspectedColumn : introspectedTable.getAllColumns()) {
sb.setLength(0);
String columnName = MyBatis3FormattingUtilities.getAliasedEscapedColumnName(introspectedColumn);
sb.append(leftPrefix + columnName);
sb.append(" = ");
sb.append(rightPrefix + columnName);
sb.append(',');
doIfNullCheck(fieldPrefix, ifNullCheck, trimElement, sb, introspectedColumn);
}
dynamicElement.addElement(trimElement);
}
示例2: buildSqlClause
import org.mybatis.generator.codegen.mybatis3.MyBatis3FormattingUtilities; //导入方法依赖的package包/类
@Override
protected XmlElement buildSqlClause(IntrospectedTable introspectedTable) {
XmlElement sql = new XmlElement("sql");
sql.addAttribute(new Attribute("id", IDENTIFIERS_ARRAY_CONDITIONS));
XmlElement foreach = new XmlElement("foreach");
foreach.addAttribute(new Attribute("collection", "array"));
foreach.addAttribute(new Attribute("item", "item"));
foreach.addAttribute(new Attribute("index", "index"));
foreach.addAttribute(new Attribute("separator", " and "));
StringBuilder sb = new StringBuilder();
for (IntrospectedColumn introspectedColumn : introspectedTable.getAllColumns()) {
XmlElement isEqualElement = new XmlElement("if");
sb.setLength(0);
sb.append("item == \'");
sb.append(introspectedColumn.getJavaProperty());
sb.append("\'");
isEqualElement.addAttribute(new Attribute("test", sb.toString()));
foreach.addElement(isEqualElement);
sb.setLength(0);
String columnName = MyBatis3FormattingUtilities.getAliasedEscapedColumnName(introspectedColumn);
sb.append(introspectedTable.getAliasedFullyQualifiedTableNameAtRuntime() + "." + columnName);
sb.append(" = ");
sb.append("temp." + columnName);
isEqualElement.addElement(new TextElement(sb.toString()));
}
sql.addElement(foreach);
return sql;
}
示例3: buildSqlClause
import org.mybatis.generator.codegen.mybatis3.MyBatis3FormattingUtilities; //导入方法依赖的package包/类
@Override protected XmlElement buildSqlClause(IntrospectedTable introspectedTable) {
XmlElement sql = new XmlElement("sql");
sql.addAttribute(new Attribute("id", IDENTIFIERS_ARRAY_CONDITIONS));
XmlElement foreach = new XmlElement("foreach");
foreach.addAttribute(new Attribute("collection", "array"));
foreach.addAttribute(new Attribute("item", "item"));
foreach.addAttribute(new Attribute("index", "index"));
foreach.addAttribute(new Attribute("separator", " and "));
StringBuilder sb = new StringBuilder();
for (IntrospectedColumn introspectedColumn : introspectedTable.getAllColumns()) {
XmlElement isEqualElement = new XmlElement("if");
sb.setLength(0);
sb.append("item == \'");
sb.append(introspectedColumn.getJavaProperty());
sb.append("\'");
isEqualElement.addAttribute(new Attribute("test", sb.toString()));
foreach.addElement(isEqualElement);
sb.setLength(0);
String columnName = MyBatis3FormattingUtilities.getAliasedEscapedColumnName(introspectedColumn);
sb.append(introspectedTable.getAliasedFullyQualifiedTableNameAtRuntime() + "." + columnName);
sb.append(" = ");
sb.append("temp." + columnName);
isEqualElement.addElement(new TextElement(sb.toString()));
}
sql.addElement(foreach);
return sql;
}