提交 e8347f12 编写于 作者: S serge-rider

ERD associations model refactoring


Former-commit-id: 97c1457d
上级 1e9eef71
......@@ -2,7 +2,7 @@
<?eclipse version="3.2"?>
<!--
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
* Copyright (C) 2011-2012 Eugene Fradkin (eugene.fradkin@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
* Copyright (C) 2011-2012 Eugene Fradkin (eugene.fradkin@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -55,7 +55,7 @@ public class AssociationCreateCommand extends Command {
List<ERDAssociation> relationships = primaryEntity.getPrimaryKeyRelationships();
for (int i = 0; i < relationships.size(); i++) {
ERDAssociation currentRelationship = relationships.get(i);
if (currentRelationship.getForeignKeyEntity().equals(foreignEntity)) {
if (currentRelationship.getForeignEntity().equals(foreignEntity)) {
returnValue = false;
break;
}
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -51,8 +51,8 @@ public class AssociationDeleteCommand extends Command
{
primaryKeyTarget.removePrimaryKeyRelationship(relationship, true);
foreignKeySource.removeForeignKeyRelationship(relationship, true);
relationship.setForeignKeyEntity(null);
relationship.setPrimaryKeyEntity(null);
relationship.setForeignEntity(null);
relationship.setPrimaryEntity(null);
}
/**
......@@ -61,8 +61,8 @@ public class AssociationDeleteCommand extends Command
@Override
public void undo()
{
relationship.setForeignKeyEntity(foreignKeySource);
relationship.setForeignKeyEntity(primaryKeyTarget);
relationship.setForeignEntity(foreignKeySource);
relationship.setForeignEntity(primaryKeyTarget);
foreignKeySource.addForeignKeyRelationship(relationship, true);
primaryKeyTarget.addPrimaryKeyRelationship(relationship, true);
}
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -53,7 +53,7 @@ public class AssociationReconnectSourceCommand extends Command
boolean returnVal = true;
ERDEntity primaryKeyEntity = relationship.getPrimaryKeyEntity();
ERDEntity primaryKeyEntity = relationship.getPrimaryEntity();
//cannot connect to itself
if (primaryKeyEntity.equals(sourceForeignKey))
......@@ -68,8 +68,8 @@ public class AssociationReconnectSourceCommand extends Command
{
ERDAssociation relationship = ((ERDAssociation) (relationships.get(i)));
if (relationship.getPrimaryKeyEntity().equals(targetPrimaryKey)
&& relationship.getForeignKeyEntity().equals(sourceForeignKey))
if (relationship.getPrimaryEntity().equals(targetPrimaryKey)
&& relationship.getForeignEntity().equals(sourceForeignKey))
{
returnVal = false;
break;
......@@ -90,7 +90,7 @@ public class AssociationReconnectSourceCommand extends Command
if (sourceForeignKey != null)
{
oldSourceForeignKey.removeForeignKeyRelationship(relationship, true);
relationship.setForeignKeyEntity(sourceForeignKey);
relationship.setForeignEntity(sourceForeignKey);
sourceForeignKey.addForeignKeyRelationship(relationship, true);
}
}
......@@ -146,8 +146,8 @@ public class AssociationReconnectSourceCommand extends Command
public void setRelationship(ERDAssociation relationship)
{
this.relationship = relationship;
targetPrimaryKey = relationship.getPrimaryKeyEntity();
oldSourceForeignKey = relationship.getForeignKeyEntity();
targetPrimaryKey = relationship.getPrimaryEntity();
oldSourceForeignKey = relationship.getForeignEntity();
}
/**
......@@ -157,7 +157,7 @@ public class AssociationReconnectSourceCommand extends Command
public void undo()
{
sourceForeignKey.removeForeignKeyRelationship(relationship, true);
relationship.setForeignKeyEntity(oldSourceForeignKey);
relationship.setForeignEntity(oldSourceForeignKey);
oldSourceForeignKey.addForeignKeyRelationship(relationship, true);
}
}
\ No newline at end of file
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -53,7 +53,7 @@ public class AssociationReconnectTargetCommand extends Command
boolean returnVal = true;
ERDEntity foreignKeyEntity = relationship.getForeignKeyEntity();
ERDEntity foreignKeyEntity = relationship.getForeignEntity();
if (foreignKeyEntity.equals(targetPrimaryKey))
{
......@@ -68,8 +68,8 @@ public class AssociationReconnectTargetCommand extends Command
ERDAssociation relationship = ((ERDAssociation) (relationships.get(i)));
if (relationship.getForeignKeyEntity().equals(sourceForeignKey)
&& relationship.getPrimaryKeyEntity().equals(targetPrimaryKey))
if (relationship.getForeignEntity().equals(sourceForeignKey)
&& relationship.getPrimaryEntity().equals(targetPrimaryKey))
{
returnVal = false;
break;
......@@ -90,7 +90,7 @@ public class AssociationReconnectTargetCommand extends Command
if (targetPrimaryKey != null)
{
oldTargetPrimaryKey.removePrimaryKeyRelationship(relationship, true);
relationship.setPrimaryKeyEntity(targetPrimaryKey);
relationship.setPrimaryEntity(targetPrimaryKey);
targetPrimaryKey.addPrimaryKeyRelationship(relationship, true);
}
}
......@@ -146,8 +146,8 @@ public class AssociationReconnectTargetCommand extends Command
public void setRelationship(ERDAssociation relationship)
{
this.relationship = relationship;
oldTargetPrimaryKey = relationship.getPrimaryKeyEntity();
sourceForeignKey = relationship.getForeignKeyEntity();
oldTargetPrimaryKey = relationship.getPrimaryEntity();
sourceForeignKey = relationship.getForeignEntity();
}
/**
......@@ -157,7 +157,7 @@ public class AssociationReconnectTargetCommand extends Command
public void undo()
{
targetPrimaryKey.removePrimaryKeyRelationship(relationship, true);
relationship.setPrimaryKeyEntity(oldTargetPrimaryKey);
relationship.setPrimaryEntity(oldTargetPrimaryKey);
oldTargetPrimaryKey.addPrimaryKeyRelationship(relationship, true);
}
}
\ No newline at end of file
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -61,7 +61,7 @@ public class EntityDeleteCommand extends Command
for (int i = 0; i < foreignKeyRelationships.size(); i++)
{
ERDAssociation r = foreignKeyRelationships.get(i);
r.getPrimaryKeyEntity().removePrimaryKeyRelationship(r, true);
r.getPrimaryEntity().removePrimaryKeyRelationship(r, true);
t.removeForeignKeyRelationship(r, true);
}
......@@ -70,7 +70,7 @@ public class EntityDeleteCommand extends Command
for (int i = 0; i < primaryKeyRelationships.size(); i++)
{
ERDAssociation r = primaryKeyRelationships.get(i);
r.getForeignKeyEntity().removeForeignKeyRelationship(r, true);
r.getForeignEntity().removeForeignKeyRelationship(r, true);
t.removePrimaryKeyRelationship(r, true);
}
}
......@@ -115,15 +115,15 @@ public class EntityDeleteCommand extends Command
for (int i = 0; i < foreignKeyRelationships.size(); i++)
{
ERDAssociation r = foreignKeyRelationships.get(i);
r.getForeignKeyEntity().addForeignKeyRelationship(r, true);
r.getPrimaryKeyEntity().addPrimaryKeyRelationship(r, true);
r.getForeignEntity().addForeignKeyRelationship(r, true);
r.getPrimaryEntity().addPrimaryKeyRelationship(r, true);
}
foreignKeyRelationships.clear();
for (int i = 0; i < primaryKeyRelationships.size(); i++)
{
ERDAssociation r = primaryKeyRelationships.get(i);
r.getForeignKeyEntity().addForeignKeyRelationship(r, true);
r.getPrimaryKeyEntity().addPrimaryKeyRelationship(r, true);
r.getForeignEntity().addForeignKeyRelationship(r, true);
r.getPrimaryEntity().addPrimaryKeyRelationship(r, true);
}
primaryKeyRelationships.clear();
}
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
* Copyright (C) 2011-2012 Eugene Fradkin (eugene.fradkin@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -223,7 +223,7 @@ public class ERDExportGraphML implements ERDExportFormatHandler
xml.startElement("edge");
xml.addAttribute("id", edgeId);
xml.addAttribute("source", entityMap.get(entity));
xml.addAttribute("target", entityMap.get(association.getPrimaryKeyEntity()));
xml.addAttribute("target", entityMap.get(association.getPrimaryEntity()));
xml.startElement("data");
xml.addAttribute("key", "edgegraph");
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -538,22 +538,22 @@ public class DiagramLoader
xml.addAttribute(ATTR_FQ_NAME, ((DBPQualifiedObject) association).getFullyQualifiedName(DBPEvaluationContext.UI));
}
xml.addAttribute(ATTR_TYPE, association.getConstraintType().getId());
TableSaveInfo pkInfo = infoMap.get(rel.getPrimaryKeyEntity());
TableSaveInfo pkInfo = infoMap.get(rel.getPrimaryEntity());
if (pkInfo == null) {
log.error("Cannot find PK table '" + DBUtils.getObjectFullName(rel.getPrimaryKeyEntity().getObject(), DBPEvaluationContext.UI) + "' in info map");
log.error("Cannot find PK table '" + DBUtils.getObjectFullName(rel.getPrimaryEntity().getObject(), DBPEvaluationContext.UI) + "' in info map");
continue;
}
TableSaveInfo fkInfo = infoMap.get(rel.getForeignKeyEntity());
TableSaveInfo fkInfo = infoMap.get(rel.getForeignEntity());
if (fkInfo == null) {
log.error("Cannot find FK table '" + DBUtils.getObjectFullName(rel.getForeignKeyEntity().getObject(), DBPEvaluationContext.UI) + "' in info map");
log.error("Cannot find FK table '" + DBUtils.getObjectFullName(rel.getForeignEntity().getObject(), DBPEvaluationContext.UI) + "' in info map");
continue;
}
xml.addAttribute(ATTR_PK_REF, pkInfo.objectId);
xml.addAttribute(ATTR_FK_REF, fkInfo.objectId);
if (association instanceof ERDLogicalForeignKey) {
if (association instanceof ERDLogicalAssociation) {
// Save columns
for (DBSEntityAttributeRef column : ((ERDLogicalForeignKey) association).getAttributeReferences(new VoidProgressMonitor())) {
for (DBSEntityAttributeRef column : ((ERDLogicalAssociation) association).getAttributeReferences(new VoidProgressMonitor())) {
xml.startElement(TAG_COLUMN);
xml.addAttribute(ATTR_NAME, column.getAttribute().getName());
try {
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -14,9 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Created on Jul 13, 2004
*/
package org.jkiss.dbeaver.ext.erd.model;
import org.eclipse.draw2d.geometry.Point;
......@@ -38,8 +35,11 @@ public class ERDAssociation extends ERDObject<DBSEntityAssociation>
{
private static final Log log = Log.getLog(ERDAssociation.class);
private ERDEntity primaryKeyEntity;
private ERDEntity foreignKeyEntity;
private ERDEntity primaryEntity;
private ERDEntity foreignEntity;
private List<ERDEntityAttribute> primaryAttributes;
private List<ERDEntityAttribute> foreignAttributes;
private List<Point> initBends;
private Boolean identifying;
......@@ -51,15 +51,15 @@ public class ERDAssociation extends ERDObject<DBSEntityAssociation>
*/
public ERDAssociation(ERDEntity foreignEntity, ERDEntity primaryEntity, boolean reflect)
{
super(new ERDLogicalForeignKey(
super(new ERDLogicalAssociation(
foreignEntity,
foreignEntity.getObject().getName() + " -> " + primaryEntity.getObject().getName(),
"",
new ERDLogicalPrimaryKey(primaryEntity, "Primary key", "")));
this.primaryKeyEntity = primaryEntity;
this.foreignKeyEntity = foreignEntity;
this.primaryKeyEntity.addPrimaryKeyRelationship(this, reflect);
this.foreignKeyEntity.addForeignKeyRelationship(this, reflect);
this.primaryEntity = primaryEntity;
this.foreignEntity = foreignEntity;
this.primaryEntity.addPrimaryKeyRelationship(this, reflect);
this.foreignEntity.addForeignKeyRelationship(this, reflect);
}
/**
......@@ -72,44 +72,44 @@ public class ERDAssociation extends ERDObject<DBSEntityAssociation>
public ERDAssociation(DBSEntityAssociation object, ERDEntity foreignEntity, ERDEntity primaryEntity, boolean reflect)
{
super(object);
this.primaryKeyEntity = primaryEntity;
this.foreignKeyEntity = foreignEntity;
this.primaryKeyEntity.addPrimaryKeyRelationship(this, reflect);
this.foreignKeyEntity.addForeignKeyRelationship(this, reflect);
this.primaryEntity = primaryEntity;
this.foreignEntity = foreignEntity;
this.primaryEntity.addPrimaryKeyRelationship(this, reflect);
this.foreignEntity.addForeignKeyRelationship(this, reflect);
}
public boolean isLogical()
{
return getObject() instanceof ERDLogicalForeignKey;
return getObject() instanceof ERDLogicalAssociation;
}
/**
* @return Returns the foreignKeyEntity.
* @return Returns the foreignEntity.
*/
public ERDEntity getForeignKeyEntity()
public ERDEntity getForeignEntity()
{
return foreignKeyEntity;
return foreignEntity;
}
/**
* @return Returns the primaryKeyEntity.
* @return Returns the primaryEntity.
*/
public ERDEntity getPrimaryKeyEntity()
public ERDEntity getPrimaryEntity()
{
return primaryKeyEntity;
return primaryEntity;
}
public void setPrimaryKeyEntity(ERDEntity targetPrimaryKey)
public void setPrimaryEntity(ERDEntity targetPrimaryKey)
{
this.primaryKeyEntity = targetPrimaryKey;
this.primaryEntity = targetPrimaryKey;
}
/**
* @param sourceForeignKey the foreign key table you are connecting from
*/
public void setForeignKeyEntity(ERDEntity sourceForeignKey)
public void setForeignEntity(ERDEntity sourceForeignKey)
{
this.foreignKeyEntity = sourceForeignKey;
this.foreignEntity = sourceForeignKey;
}
public List<Point> getInitBends()
......@@ -129,6 +129,7 @@ public class ERDAssociation extends ERDObject<DBSEntityAssociation>
identifying = DBUtils.isIdentifyingAssociation(new VoidProgressMonitor(), getObject());
} catch (DBException e) {
log.debug(e);
identifying = false;
}
}
return identifying;
......@@ -137,7 +138,7 @@ public class ERDAssociation extends ERDObject<DBSEntityAssociation>
@Override
public String toString()
{
return getObject() + " [" + primaryKeyEntity + "->" + foreignKeyEntity + "]";
return getObject() + " [" + primaryEntity + "->" + foreignEntity + "]";
}
@NotNull
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -193,7 +193,7 @@ public class ERDEntity extends ERDObject<DBSEntity>
{
if (foreignKeyRelationships != null) {
for (ERDAssociation association : foreignKeyRelationships) {
if (association.getPrimaryKeyEntity() == this) {
if (association.getPrimaryEntity() == this) {
return true;
}
}
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.ext.erd.model;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.ext.erd.ERDConstants;
import org.jkiss.dbeaver.model.DBPDataSource;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.struct.*;
import java.util.ArrayList;
import java.util.List;
/**
* Logical foreign key
*/
public class ERDLogicalForeignKey implements DBSEntityAssociation, DBSEntityReferrer {
private DBSEntity entity;
private String name;
private String description;
private ERDLogicalPrimaryKey pk;
private List<? extends DBSEntityAttributeRef> columns = new ArrayList<>();
public ERDLogicalForeignKey(ERDEntity entity, String name, String description, ERDLogicalPrimaryKey pk)
{
this.entity = entity.getObject();
this.name = name;
this.description = description;
this.pk = pk;
}
@Nullable
@Override
public DBSEntityConstraint getReferencedConstraint()
{
return pk;
}
@Override
public DBSEntity getAssociatedEntity()
{
return pk.getParentObject();
}
@NotNull
@Override
public DBPDataSource getDataSource()
{
return entity.getDataSource();
}
@Nullable
@Override
public String getDescription()
{
return description;
}
@NotNull
@Override
public DBSEntity getParentObject()
{
return entity;
}
@NotNull
@Override
public DBSEntityConstraintType getConstraintType()
{
return ERDConstants.CONSTRAINT_LOGICAL_FK;
}
@NotNull
@Override
public String getName()
{
return name;
}
@Override
public boolean isPersisted()
{
return false;
}
@Override
public List<? extends DBSEntityAttributeRef> getAttributeReferences(DBRProgressMonitor monitor)
{
return columns;
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.ext.erd.model;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.ext.erd.ERDConstants;
import org.jkiss.dbeaver.model.DBPDataSource;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.struct.*;
import java.util.ArrayList;
import java.util.List;
/**
* Logical foreign key
*/
public class ERDLogicalAssociation implements DBSEntityAssociation, DBSEntityReferrer {
private DBSEntity entity;
private String name;
private String description;
private ERDLogicalPrimaryKey pk;
private List<? extends DBSEntityAttributeRef> columns = new ArrayList<>();
public ERDLogicalAssociation(ERDEntity entity, String name, String description, ERDLogicalPrimaryKey pk)
{
this.entity = entity.getObject();
this.name = name;
this.description = description;
this.pk = pk;
}
@Nullable
@Override
public DBSEntityConstraint getReferencedConstraint()
{
return pk;
}
@Override
public DBSEntity getAssociatedEntity()
{
return pk.getParentObject();
}
@NotNull
@Override
public DBPDataSource getDataSource()
{
return entity.getDataSource();
}
@Nullable
@Override
public String getDescription()
{
return description;
}
@NotNull
@Override
public DBSEntity getParentObject()
{
return entity;
}
@NotNull
@Override
public DBSEntityConstraintType getConstraintType()
{
return ERDConstants.CONSTRAINT_LOGICAL_FK;
}
@NotNull
@Override
public String getName()
{
return name;
}
@Override
public boolean isPersisted()
{
return false;
}
@Override
public List<? extends DBSEntityAttributeRef> getAttributeReferences(DBRProgressMonitor monitor)
{
return columns;
}
}
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -133,7 +133,7 @@ public class EntityDiagram extends ERDObject<DBSObject>
if (reflect) {
for (ERDAssociation rel : entity.getPrimaryKeyRelationships()) {
rel.getForeignKeyEntity().firePropertyChange(OUTPUT, null, rel);
rel.getForeignEntity().firePropertyChange(OUTPUT, null, rel);
}
}
}
......@@ -346,7 +346,7 @@ public class EntityDiagram extends ERDObject<DBSObject>
public void addInitRelationBends(ERDEntity sourceEntity, ERDEntity targetEntity, String relName, List<Point> bends)
{
for (ERDAssociation rel : sourceEntity.getPrimaryKeyRelationships()) {
if (rel.getForeignKeyEntity() == targetEntity && relName.equals(rel.getObject().getName())) {
if (rel.getForeignEntity() == targetEntity && relName.equals(rel.getObject().getName())) {
rel.setInitBends(bends);
}
}
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
* Copyright (C) 2011-2012 Eugene Fradkin (eugene.fradkin@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
* Copyright (C) 2011-2012 Eugene Fradkin (eugene.fradkin@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -139,7 +139,7 @@ public class AssociationPart extends PropertyAwareConnectionPart {
connBends.add(new AbsoluteBendpoint(bend.x, bend.y));
}
conn.setRoutingConstraint(connBends);
} else if (association.getPrimaryKeyEntity() == association.getForeignKeyEntity()) {
} else if (association.getPrimaryEntity() == association.getForeignEntity()) {
// Self link
final IFigure entityFigure = ((GraphicalEditPart) getSource()).getFigure();
//EntityPart entity = (EntityPart) connEdge.source.getParent().data;
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
* Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册