use of org.mybatis.generator.config.JavaClientGeneratorConfiguration in project generator by mybatis.
the class IntrospectedTable method calculateJavaClientInterfacePackage.
/**
* Calculate java client interface package.
*
* @return the string
*/
protected String calculateJavaClientInterfacePackage() {
JavaClientGeneratorConfiguration config = context.getJavaClientGeneratorConfiguration();
if (config == null) {
return null;
}
StringBuilder sb = new StringBuilder();
sb.append(config.getTargetPackage());
sb.append(fullyQualifiedTable.getSubPackageForClientOrSqlMap(isSubPackagesEnabled(config)));
return sb.toString();
}
use of org.mybatis.generator.config.JavaClientGeneratorConfiguration in project generator by mybatis.
the class IntrospectedTable method calculateJavaClientImplementationPackage.
/**
* Calculate java client implementation package.
*
* @return the string
*/
protected String calculateJavaClientImplementationPackage() {
JavaClientGeneratorConfiguration config = context.getJavaClientGeneratorConfiguration();
if (config == null) {
return null;
}
StringBuilder sb = new StringBuilder();
if (stringHasValue(config.getImplementationPackage())) {
sb.append(config.getImplementationPackage());
} else {
sb.append(config.getTargetPackage());
}
sb.append(fullyQualifiedTable.getSubPackageForClientOrSqlMap(isSubPackagesEnabled(config)));
return sb.toString();
}
use of org.mybatis.generator.config.JavaClientGeneratorConfiguration in project generator by mybatis.
the class MyBatisGeneratorConfigurationParser method parseJavaClientGenerator.
private void parseJavaClientGenerator(Context context, Node node) {
JavaClientGeneratorConfiguration javaClientGeneratorConfiguration = new JavaClientGeneratorConfiguration();
context.setJavaClientGeneratorConfiguration(javaClientGeneratorConfiguration);
Properties attributes = parseAttributes(node);
//$NON-NLS-1$
String type = attributes.getProperty("type");
//$NON-NLS-1$
String targetPackage = attributes.getProperty("targetPackage");
//$NON-NLS-1$
String targetProject = attributes.getProperty("targetProject");
String implementationPackage = attributes.getProperty(//$NON-NLS-1$
"implementationPackage");
javaClientGeneratorConfiguration.setConfigurationType(type);
javaClientGeneratorConfiguration.setTargetPackage(targetPackage);
javaClientGeneratorConfiguration.setTargetProject(targetProject);
javaClientGeneratorConfiguration.setImplementationPackage(implementationPackage);
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(javaClientGeneratorConfiguration, childNode);
}
}
}
use of org.mybatis.generator.config.JavaClientGeneratorConfiguration in project generator by mybatis.
the class IbatorConfigurationParser method parseDaoGenerator.
private void parseDaoGenerator(Context context, Node node) {
JavaClientGeneratorConfiguration javaClientGeneratorConfiguration = new JavaClientGeneratorConfiguration();
context.setJavaClientGeneratorConfiguration(javaClientGeneratorConfiguration);
Properties attributes = parseAttributes(node);
//$NON-NLS-1$
String type = attributes.getProperty("type");
//$NON-NLS-1$
String targetPackage = attributes.getProperty("targetPackage");
//$NON-NLS-1$
String targetProject = attributes.getProperty("targetProject");
String implementationPackage = attributes.getProperty(//$NON-NLS-1$
"implementationPackage");
javaClientGeneratorConfiguration.setConfigurationType(type);
javaClientGeneratorConfiguration.setTargetPackage(targetPackage);
javaClientGeneratorConfiguration.setTargetProject(targetProject);
javaClientGeneratorConfiguration.setImplementationPackage(implementationPackage);
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(javaClientGeneratorConfiguration, childNode);
}
}
}
Aggregations