本文整理匯總了Java中org.mybatis.generator.api.dom.xml.XmlElement類的典型用法代碼示例。如果您正苦於以下問題:Java XmlElement類的具體用法?Java XmlElement怎麽用?Java XmlElement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
XmlElement類屬於org.mybatis.generator.api.dom.xml包,在下文中一共展示了XmlElement類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: toXmlElement
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
public XmlElement toXmlElement() {
XmlElement answer = new XmlElement("javaClientGenerator"); //$NON-NLS-1$
if (getConfigurationType() != null) {
answer.addAttribute(new Attribute("type", getConfigurationType())); //$NON-NLS-1$
}
if (targetPackage != null) {
answer.addAttribute(new Attribute("targetPackage", targetPackage)); //$NON-NLS-1$
}
if (targetProject != null) {
answer.addAttribute(new Attribute("targetProject", targetProject)); //$NON-NLS-1$
}
if (implementationPackage != null) {
answer.addAttribute(new Attribute(
"implementationPackage", targetProject)); //$NON-NLS-1$
}
addPropertyXmlElements(answer);
return answer;
}
示例2: toXmlElement
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
public XmlElement toXmlElement() {
XmlElement xmlElement = new XmlElement("jdbcConnection"); //$NON-NLS-1$
xmlElement.addAttribute(new Attribute("driverClass", driverClass)); //$NON-NLS-1$
xmlElement.addAttribute(new Attribute("connectionURL", connectionURL)); //$NON-NLS-1$
if (stringHasValue(userId)) {
xmlElement.addAttribute(new Attribute("userId", userId)); //$NON-NLS-1$
}
if (stringHasValue(password)) {
xmlElement.addAttribute(new Attribute("password", password)); //$NON-NLS-1$
}
addPropertyXmlElements(xmlElement);
return xmlElement;
}
開發者ID:xiachengwei5,項目名稱:org.mybatis.generator.core-1.3.5,代碼行數:18,代碼來源:JDBCConnectionConfiguration.java
示例3: addElements
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
@Override
public void addElements(XmlElement parentElement) {
XmlElement answer = new XmlElement("select"); //$NON-NLS-1$
String fqjt = introspectedTable.getExampleType();
answer.addAttribute(new Attribute(
"id", introspectedTable.getCountByExampleStatementId())); //$NON-NLS-1$
answer.addAttribute(new Attribute("parameterType", fqjt)); //$NON-NLS-1$
answer.addAttribute(new Attribute("resultType", "java.lang.Long")); //$NON-NLS-1$ //$NON-NLS-2$
context.getCommentGenerator().addComment(answer);
StringBuilder sb = new StringBuilder();
sb.append("select count(*) from "); //$NON-NLS-1$
sb.append(introspectedTable
.getAliasedFullyQualifiedTableNameAtRuntime());
answer.addElement(new TextElement(sb.toString()));
answer.addElement(getExampleIncludeElement());
if (context.getPlugins().sqlMapCountByExampleElementGenerated(
answer, introspectedTable)) {
parentElement.addElement(answer);
}
}
示例4: addElements
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
@Override
public void addElements(XmlElement parentElement) {
XmlElement answer = new XmlElement("delete"); //$NON-NLS-1$
String fqjt = introspectedTable.getExampleType();
answer.addAttribute(new Attribute(
"id", introspectedTable.getDeleteByExampleStatementId())); //$NON-NLS-1$
answer.addAttribute(new Attribute("parameterType", fqjt)); //$NON-NLS-1$
context.getCommentGenerator().addComment(answer);
StringBuilder sb = new StringBuilder();
sb.append("delete from "); //$NON-NLS-1$
sb.append(introspectedTable
.getAliasedFullyQualifiedTableNameAtRuntime());
answer.addElement(new TextElement(sb.toString()));
answer.addElement(getExampleIncludeElement());
if (context.getPlugins().sqlMapDeleteByExampleElementGenerated(
answer, introspectedTable)) {
parentElement.addElement(answer);
}
}
示例5: getSqlMapElement
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
protected XmlElement getSqlMapElement() {
FullyQualifiedTable table = introspectedTable.getFullyQualifiedTable();
progressCallback.startTask(getString("Progress.12", table.toString())); //$NON-NLS-1$
XmlElement answer = new XmlElement("mapper"); //$NON-NLS-1$
String namespace = introspectedTable.getMyBatis3SqlMapNamespace();
answer.addAttribute(new Attribute("namespace", //$NON-NLS-1$
namespace));
context.getCommentGenerator().addRootComment(answer);
addResultMapElement(answer);
addDeleteByPrimaryKeyElement(answer);
addInsertElement(answer);
addUpdateByPrimaryKeyElement(answer);
addSelectByPrimaryKeyElement(answer);
addSelectAllElement(answer);
return answer;
}
示例6: sqlMapUpdateByPrimaryKeyWithoutBLOBsElementGenerated
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
public boolean sqlMapUpdateByPrimaryKeyWithoutBLOBsElementGenerated(
XmlElement element, IntrospectedTable introspectedTable) {
boolean rc = true;
for (Plugin plugin : plugins) {
if (!plugin.sqlMapUpdateByPrimaryKeyWithoutBLOBsElementGenerated(
element, introspectedTable)) {
rc = false;
break;
}
}
return rc;
}
示例7: addCdataNode2
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
private void addCdataNode2(CommentGenerator commentGenerator, XmlElement parentElement) {
XmlElement answer = new XmlElement("select");
answer.addAttribute(new Attribute("id", "selectWithCdata2"));
commentGenerator.addComment(answer);
answer.addElement(new TextElement("select foo from bar where foo <![CDATA[ < ]]> 22"));
parentElement.addElement(answer);
}
示例8: sqlMapSelectAllElementGenerated
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
public boolean sqlMapSelectAllElementGenerated(XmlElement element,
IntrospectedTable introspectedTable) {
boolean rc = true;
for (Plugin plugin : plugins) {
if (!plugin.sqlMapSelectAllElementGenerated(element, introspectedTable)) {
rc = false;
break;
}
}
return rc;
}
示例9: addComment
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
public void addComment(XmlElement xmlElement) {
if (!this.suppressAllComments) {
xmlElement.addElement(new TextElement("<!--"));
StringBuilder sb = new StringBuilder();
sb.append(" WARNING - ");
sb.append("@mbg.generated");
xmlElement.addElement(new TextElement(sb.toString()));
xmlElement.addElement(new TextElement(" This element is automatically generated by MyBatis Generator, do not modify."));
xmlElement.addElement(new TextElement("-->"));
}
}
示例10: addElements
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
@Override
public void addElements(XmlElement parentElement) {
XmlElement answer = new XmlElement("select"); //$NON-NLS-1$
answer.addAttribute(new Attribute(
"id", introspectedTable.getCountByExampleStatementId())); //$NON-NLS-1$
answer.addAttribute(new Attribute(
"parameterClass", introspectedTable.getExampleType())); //$NON-NLS-1$
answer.addAttribute(new Attribute("resultClass", "java.lang.Long")); //$NON-NLS-1$ //$NON-NLS-2$
context.getCommentGenerator().addComment(answer);
StringBuilder sb = new StringBuilder();
sb.append("select count(*) from "); //$NON-NLS-1$
sb.append(introspectedTable
.getAliasedFullyQualifiedTableNameAtRuntime());
answer.addElement(new TextElement(sb.toString()));
XmlElement includeElement = new XmlElement("include"); //$NON-NLS-1$
sb.setLength(0);
sb.append(introspectedTable.getIbatis2SqlMapNamespace());
sb.append('.');
sb.append(introspectedTable.getExampleWhereClauseId());
includeElement.addAttribute(new Attribute("refid", //$NON-NLS-1$
sb.toString()));
answer.addElement(includeElement);
if (context.getPlugins().sqlMapCountByExampleElementGenerated(
answer, introspectedTable)) {
parentElement.addElement(answer);
}
}
示例11: addUpdateByPrimaryKeyWithBLOBsElement
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
protected void addUpdateByPrimaryKeyWithBLOBsElement(
XmlElement parentElement) {
if (introspectedTable.getRules().generateUpdateByPrimaryKeyWithBLOBs()) {
AbstractXmlElementGenerator elementGenerator = new UpdateByPrimaryKeyWithBLOBsElementGenerator();
initializeAndExecuteGenerator(elementGenerator, parentElement);
}
}
示例12: sqlMapSelectByExampleWithoutBLOBsElementGenerated
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
@Override
public boolean sqlMapSelectByExampleWithoutBLOBsElementGenerated(
XmlElement element, IntrospectedTable introspectedTable) {
if (introspectedTable.getTargetRuntime() == TargetRuntime.MYBATIS3) {
copyAndSaveElement(element, introspectedTable.getFullyQualifiedTable());
}
return true;
}
示例13: sqlMapSelectByPrimaryKeyElementGenerated
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
@Override
public boolean sqlMapSelectByPrimaryKeyElementGenerated(XmlElement element,
IntrospectedTable introspectedTable) {
boolean rc = true;
for (Plugin plugin : plugins) {
if (!plugin.sqlMapSelectByPrimaryKeyElementGenerated(element,
introspectedTable)) {
rc = false;
break;
}
}
return rc;
}
示例14: sqlMapBaseColumnListElementGenerated
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
public boolean sqlMapBaseColumnListElementGenerated(XmlElement element,
IntrospectedTable introspectedTable) {
boolean rc = true;
for (Plugin plugin : plugins) {
if (!plugin.sqlMapBaseColumnListElementGenerated(element,
introspectedTable)) {
rc = false;
break;
}
}
return rc;
}
示例15: getUpdateByExampleIncludeElement
import org.mybatis.generator.api.dom.xml.XmlElement; //導入依賴的package包/類
protected XmlElement getUpdateByExampleIncludeElement() {
XmlElement ifElement = new XmlElement("if"); //$NON-NLS-1$
ifElement.addAttribute(new Attribute("test", "_parameter != null")); //$NON-NLS-1$ //$NON-NLS-2$
XmlElement includeElement = new XmlElement("include"); //$NON-NLS-1$
includeElement.addAttribute(new Attribute("refid", //$NON-NLS-1$
introspectedTable.getMyBatis3UpdateByExampleWhereClauseId()));
ifElement.addElement(includeElement);
return ifElement;
}