use of org.jkiss.dbeaver.model.virtual.DBVEntityForeignKeyColumn in project dbeaver by serge-rider.
the class DBDAttributeBinding method findVirtualReferrers.
protected List<DBSEntityReferrer> findVirtualReferrers() {
DBSDataContainer dataContainer = getDataContainer();
if (dataContainer instanceof DBSEntity) {
DBSEntity attrEntity = (DBSEntity) dataContainer;
DBVEntity vEntity = DBVUtils.getVirtualEntity(attrEntity, false);
if (vEntity != null) {
List<DBVEntityForeignKey> foreignKeys = vEntity.getForeignKeys();
if (!CommonUtils.isEmpty(foreignKeys)) {
List<DBSEntityReferrer> referrers = null;
for (DBVEntityForeignKey vfk : foreignKeys) {
for (DBVEntityForeignKeyColumn vfkc : vfk.getAttributes()) {
if (CommonUtils.equalObjects(vfkc.getAttributeName(), getFullyQualifiedName(DBPEvaluationContext.DML))) {
if (referrers == null) {
referrers = new ArrayList<>();
}
referrers.add(vfk);
}
}
}
return referrers;
}
}
}
return null;
}
Aggregations