提交 18e2af5f 编写于 作者: S Serge Rider

#1091 Entity unique key searching fix (handle missing constraints)

上级 ce62f16e
......@@ -28,7 +28,6 @@ import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.struct.*;
import org.jkiss.dbeaver.model.struct.rdb.DBSTable;
import org.jkiss.dbeaver.model.struct.rdb.DBSTableColumn;
import org.jkiss.dbeaver.model.struct.rdb.DBSTableIndex;
import org.jkiss.utils.CommonUtils;
......@@ -312,7 +311,7 @@ public class ERDEntity extends ERDObject<DBSEntity>
// Find PK or unique key
DBSEntityConstraint uniqueId = null;
//DBSEntityConstraint uniqueIndex = null;
for (DBSEntityConstraint id : entity.getConstraints(monitor)) {
for (DBSEntityConstraint id : CommonUtils.safeCollection(entity.getConstraints(monitor))) {
if (id instanceof DBSEntityReferrer && id.getConstraintType() == DBSEntityConstraintType.PRIMARY_KEY) {
return DBUtils.getEntityAttributes(monitor, (DBSEntityReferrer) id);
} else if (id.getConstraintType().isUnique()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册