Skip to content

Commit

Permalink
fixTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Yingjian Wu committed Jun 2, 2024
1 parent 8b19fab commit 29b10a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class ParentChildRelMetadataServiceSpec extends Specification{

// Test New Child
def child_parent_expected = new ParentInfo(parent.toString(), type)
assert child_parent_expected == service.getParent(child)
assert child_parent_expected == service.getParent(newChild)
assert service.getChildren(child).size() == 0
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ public class MySqlParentChildRelMetaDataService implements ParentChildRelMetadat
static final String SQL_RENAME_CHILD_ENTITY = "UPDATE parent_child_relation "
+ "SET child = ? WHERE child = ?";

static final String SQL_DROP_ENTITY =
"DELETE FROM parent_child_relation "
static final String SQL_DROP_ENTITY = "DELETE FROM parent_child_relation "
+ "WHERE child = ? "
+ "AND NOT EXISTS (SELECT 1 FROM parent_child_relation WHERE parent = ?)";
+ "AND NOT EXISTS (SELECT 1 FROM (SELECT * FROM parent_child_relation) AS temp WHERE temp.parent = ?)";

static final String SQL_GET_PARENTS = "SELECT parent, relation_type FROM parent_child_relation WHERE child = ?";

Expand Down

0 comments on commit 29b10a9

Please sign in to comment.