提交 97c05edc 编写于 作者: L LonwoLonwo

#10219 view format options saving

上级 db256091
...@@ -175,12 +175,13 @@ public class OracleMaterializedView extends OracleTableBase implements OracleSou ...@@ -175,12 +175,13 @@ public class OracleMaterializedView extends OracleTableBase implements OracleSou
currentDDLFormat = OracleDDLFormat.getCurrentFormat(getDataSource()); currentDDLFormat = OracleDDLFormat.getCurrentFormat(getDataSource());
} }
OracleDDLFormat newFormat = OracleDDLFormat.FULL; OracleDDLFormat newFormat = OracleDDLFormat.FULL;
if (options.containsKey(OracleConstants.PREF_KEY_DDL_FORMAT)) { boolean isFormatInOptions = options.containsKey(OracleConstants.PREF_KEY_DDL_FORMAT);
if (isFormatInOptions) {
newFormat = (OracleDDLFormat) options.get(OracleConstants.PREF_KEY_DDL_FORMAT); newFormat = (OracleDDLFormat) options.get(OracleConstants.PREF_KEY_DDL_FORMAT);
} }
if (query == null || currentDDLFormat != newFormat && isPersisted()) { if (query == null || currentDDLFormat != newFormat && isPersisted()) {
try { try {
if (query == null) { if (query == null || !isFormatInOptions) {
query = OracleUtils.getDDL(monitor, getTableTypeName(), this, currentDDLFormat, options); query = OracleUtils.getDDL(monitor, getTableTypeName(), this, currentDDLFormat, options);
} else { } else {
query = OracleUtils.getDDL(monitor, getTableTypeName(), this, newFormat, options); query = OracleUtils.getDDL(monitor, getTableTypeName(), this, newFormat, options);
......
...@@ -123,13 +123,14 @@ public class OracleView extends OracleTableBase implements OracleSourceObject, D ...@@ -123,13 +123,14 @@ public class OracleView extends OracleTableBase implements OracleSourceObject, D
currentDDLFormat = OracleDDLFormat.getCurrentFormat(getDataSource()); currentDDLFormat = OracleDDLFormat.getCurrentFormat(getDataSource());
} }
OracleDDLFormat newFormat = OracleDDLFormat.FULL; OracleDDLFormat newFormat = OracleDDLFormat.FULL;
if (options.containsKey(OracleConstants.PREF_KEY_DDL_FORMAT)) { boolean isFormatInOptions = options.containsKey(OracleConstants.PREF_KEY_DDL_FORMAT);
if (isFormatInOptions) {
newFormat = (OracleDDLFormat) options.get(OracleConstants.PREF_KEY_DDL_FORMAT); newFormat = (OracleDDLFormat) options.get(OracleConstants.PREF_KEY_DDL_FORMAT);
} }
if (viewText == null || currentDDLFormat != newFormat) { if (viewText == null || currentDDLFormat != newFormat) {
try { try {
if (viewText == null) { if (viewText == null || !isFormatInOptions) {
viewText = OracleUtils.getDDL(monitor, getTableTypeName(), this, currentDDLFormat, options); viewText = OracleUtils.getDDL(monitor, getTableTypeName(), this, currentDDLFormat, options);
} else { } else {
viewText = OracleUtils.getDDL(monitor, getTableTypeName(), this, newFormat, options); viewText = OracleUtils.getDDL(monitor, getTableTypeName(), this, newFormat, options);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册