use of org.mybatis.generator.config.JavaModelGeneratorConfiguration in project generator by mybatis.
the class MyBatisGeneratorConfigurationParser method parseJavaModelGenerator.
protected void parseJavaModelGenerator(Context context, Node node) {
JavaModelGeneratorConfiguration javaModelGeneratorConfiguration = new JavaModelGeneratorConfiguration();
context.setJavaModelGeneratorConfiguration(javaModelGeneratorConfiguration);
Properties attributes = parseAttributes(node);
//$NON-NLS-1$
String targetPackage = attributes.getProperty("targetPackage");
//$NON-NLS-1$
String targetProject = attributes.getProperty("targetProject");
javaModelGeneratorConfiguration.setTargetPackage(targetPackage);
javaModelGeneratorConfiguration.setTargetProject(targetProject);
NodeList nodeList = node.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
Node childNode = nodeList.item(i);
if (childNode.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
if ("property".equals(childNode.getNodeName())) {
//$NON-NLS-1$
parseProperty(javaModelGeneratorConfiguration, childNode);
}
}
}
use of org.mybatis.generator.config.JavaModelGeneratorConfiguration in project generator by mybatis.
the class IntrospectedTable method calculateJavaModelPackage.
/**
* Calculate java model package.
*
* @return the string
*/
protected String calculateJavaModelPackage() {
JavaModelGeneratorConfiguration config = context.getJavaModelGeneratorConfiguration();
StringBuilder sb = new StringBuilder();
sb.append(config.getTargetPackage());
sb.append(fullyQualifiedTable.getSubPackageForModel(isSubPackagesEnabled(config)));
return sb.toString();
}
Aggregations