提交 c8ef4e6b 编写于 作者: S Serge Rider

CB-1233 ResultSet singe entity mode

上级 0f50353e
......@@ -891,4 +891,23 @@ public class DBExecUtils {
return actions;
}
@Nullable
public static DBSEntity detectSingleSourceTable(DBDAttributeBinding ... attributes) {
// Check single source flag
DBSEntity sourceTable = null;
for (DBDAttributeBinding attribute : attributes) {
if (attribute.isPseudoAttribute()) {
continue;
}
DBDRowIdentifier rowIdentifier = attribute.getRowIdentifier();
if (rowIdentifier != null) {
if (sourceTable == null) {
sourceTable = rowIdentifier.getEntity();
} else if (sourceTable != rowIdentifier.getEntity()) {
return null;
}
}
}
return sourceTable;
}
}
\ No newline at end of file
......@@ -659,28 +659,8 @@ public class ResultSetModel {
this.visibleAttributes.sort(POSITION_SORTER);
if (singleSourceEntity == null) {
// Check single source flag
DBSEntity sourceTable = null;
for (DBDAttributeBinding attribute : visibleAttributes) {
if (attribute.isPseudoAttribute()) {
continue;
}
DBDRowIdentifier rowIdentifier = attribute.getRowIdentifier();
if (rowIdentifier != null) {
if (sourceTable == null) {
sourceTable = rowIdentifier.getEntity();
} else if (sourceTable != rowIdentifier.getEntity()) {
sourceTable = null;
break;
}
} else {
// Do not mark it a multi-source.
// It is just some column without identifier, probably a constant or an expression
//singleSourceCells = false;
//break;
}
}
singleSourceEntity = sourceTable;
singleSourceEntity = DBExecUtils.detectSingleSourceTable(
visibleAttributes.toArray(new DBDAttributeBinding[0]));
}
hasData = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册