Skip to content

Commit f08052d

Browse files
author
杨利兵
committed
添加 BaseSqlTranslator.java
1 parent 3b7c123 commit f08052d

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

src/com/yanglb/utilitys/codegen/core/translator/BaseDdlTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import com.yanglb.utilitys.codegen.support.SupportLang;
2828
import com.yanglb.utilitys.codegen.utility.StringUtility;
2929

30-
public class BaseDdlTranslator extends BaseTranslator<List<DdlModel>> {
30+
public class BaseDdlTranslator extends BaseSqlTranslator<List<DdlModel>> {
3131
// 外键关系列表
3232
protected List<ForeignModel> foreignKeyList = new ArrayList<ForeignModel>();
3333

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Copyright 2020 yanglb.com
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.yanglb.utilitys.codegen.core.translator;
17+
18+
public class BaseSqlTranslator<T> extends BaseTranslator<T> {
19+
// 列引号字符,如:SQL Server为[], MySQL为`等
20+
protected String sqlColumnStart = "\"";
21+
protected String sqlColumnEnd = "\"";
22+
}

src/com/yanglb/utilitys/codegen/core/translator/BaseTranslator.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ public class BaseTranslator<T> implements ITranslator<T> {
3232
protected HashMap<String, String> settingMap;
3333
protected ParamaModel paramaModel;
3434

35-
// 列引号字符,如:SQL Server为[], MySQL为`等
36-
protected String sqlColumnStart = "\"";
37-
protected String sqlColumnEnd = "\"";
38-
3935
protected BaseTranslator() {
4036
this.writableModel = new WritableModel();
4137
}

src/com/yanglb/utilitys/codegen/core/translator/impl/DmlTranslatorImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121

2222
import com.yanglb.utilitys.codegen.core.model.DmlModel;
2323
import com.yanglb.utilitys.codegen.core.model.TableModel;
24-
import com.yanglb.utilitys.codegen.core.translator.BaseTranslator;
24+
import com.yanglb.utilitys.codegen.core.translator.BaseSqlTranslator;
2525
import com.yanglb.utilitys.codegen.exceptions.CodeGenException;
2626
import com.yanglb.utilitys.codegen.support.SupportLang;
2727
import com.yanglb.utilitys.codegen.utility.StringUtility;
2828

29-
public class DmlTranslatorImpl extends BaseTranslator<List<DmlModel>> {
29+
public class DmlTranslatorImpl extends BaseSqlTranslator<List<DmlModel>> {
3030
@Override
3131
protected void onBeforeTranslate() throws CodeGenException {
3232
super.onBeforeTranslate();

0 commit comments

Comments
 (0)