Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
zouzg committed Aug 7, 2017
2 parents ba6be2e + 2ba70cf commit 9ac4188
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ public class MybatisGeneratorBridge {
private List<IgnoredColumn> ignoredColumns;

private List<ColumnOverride> columnOverrides;
/**
* The Context will share between all controller to be a the mybatis generator configuration collector
*/
private static Configuration configuration = new Configuration();
private static Context context = new Context(ModelType.CONDITIONAL);

static {
configuration.addContext(context);
context.addProperty("javaFileEncoding", "UTF-8");
}

public MybatisGeneratorBridge() {
}
Expand All @@ -62,6 +52,10 @@ public void setDatabaseConfig(DatabaseConfig databaseConfig) {
}

public void generate() throws Exception {
Configuration configuration = new Configuration();
Context context = new Context(ModelType.CONDITIONAL);
configuration.addContext(context);
context.addProperty("javaFileEncoding", "UTF-8");
String connectorLibPath = ConfigHelper.findConnectorLibPath(selectedDatabaseConfig.getDbType());
_LOG.info("connectorLibPath: {}", connectorLibPath);
configuration.addClasspathEntry(connectorLibPath);
Expand Down Expand Up @@ -160,10 +154,6 @@ public void generate() throws Exception {
myBatisGenerator.generate(progressCallback, contexts, fullyqualifiedTables);
}

public static Context getContext() {
return context;
}

public void setProgressCallback(ProgressCallback progressCallback) {
this.progressCallback = progressCallback;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void addModelClassComment(TopLevelClass topLevelClass,
topLevelClass.addJavaDocLine(" * @author ");
topLevelClass.addJavaDocLine(" */");
if(isAnnotations) {
topLevelClass.addAnnotation("@Talbe(name=\"" + introspectedTable.getFullyQualifiedTableNameAtRuntime() + "\")");
topLevelClass.addAnnotation("@Table(name=\"" + introspectedTable.getFullyQualifiedTableNameAtRuntime() + "\")");
}
}

Expand Down

0 comments on commit 9ac4188

Please sign in to comment.