Browse Source

Pull request #7608: REPORT-85191【国产化】配置库适配GoldenDB

Merge in CORE/base-third from ~LIDONGY/base-third:feature/x to feature/x

* commit '9363fd68faa1d1708e23351a71f95ab2dab7b908':
  REPORT-85191【国产化】配置库适配GoldenDB
feature/x
lidongy-李东原 2 years ago
parent
commit
60b31d428e
  1. 18
      fine-hibernate/src/main/java/com/fr/third/org/hibernate/dialect/Dialect.java
  2. 2
      fine-hibernate/src/main/java/com/fr/third/org/hibernate/mapping/Column.java
  3. 4
      fine-hibernate/src/main/java/com/fr/third/org/hibernate/mapping/PrimaryKey.java
  4. 2
      fine-hibernate/src/main/java/com/fr/third/org/hibernate/tool/schema/internal/StandardTableExporter.java

18
fine-hibernate/src/main/java/com/fr/third/org/hibernate/dialect/Dialect.java

@ -2806,4 +2806,22 @@ public abstract class Dialect implements ConversionContext {
return buf.append(')').toString();
}
/**
* 获取建表时分发策略字符串
*
* @param columnList 主键列集合
* @return String
*/
public String sqlDistributeString(List<Column> columnList) {
return "";
}
/**
* 是否强制添加引用符号
*
* @return /
*/
public boolean forceQuote() {
return false;
}
}

2
fine-hibernate/src/main/java/com/fr/third/org/hibernate/mapping/Column.java

@ -96,7 +96,7 @@ public class Column implements Selectable, Serializable, Cloneable {
}
public String getQuotedName(Dialect d) {
return quoted ?
return quoted || d.forceQuote() ?
d.openQuote() + name + d.closeQuote() :
name;
}

4
fine-hibernate/src/main/java/com/fr/third/org/hibernate/mapping/PrimaryKey.java

@ -75,6 +75,10 @@ public class PrimaryKey extends Constraint {
return buf.append(')').toString();
}
public String sqlDistributeString(Dialect dialect) {
return dialect.sqlDistributeString(getColumns());
}
public String generatedConstraintNamePrefix() {
return "PK_";
}

2
fine-hibernate/src/main/java/com/fr/third/org/hibernate/tool/schema/internal/StandardTableExporter.java

@ -154,6 +154,8 @@ public class StandardTableExporter implements Exporter<Table> {
applyInitCommands( table, sqlStrings );
buf.append(table.getPrimaryKey().sqlDistributeString(dialect));
return sqlStrings.toArray( new String[ sqlStrings.size() ] );
}

Loading…
Cancel
Save