@@ -167,16 +167,7 @@ private void writeTableRelationships() {
167
167
}
168
168
}
169
169
170
- // now directly connect the loose ends to the title of the
171
- // 2nd degree of separation tables
172
- for (Edge edge : allCousinEdges ) {
173
- if (this .isCousinTable (edge .getParentTable (), allCousins , relatedTables )) {
174
- edge .connectToParentTitle ();
175
- }
176
- if (this .isCousinTable (edge .getChildTable (), allCousins , relatedTables )) {
177
- edge .connectToChildTitle ();
178
- }
179
- }
170
+ connectLooseEnds (allCousinEdges , allCousins , relatedTables );
180
171
181
172
// include the table itself
182
173
nodes .put (table , new DotNode (table , false , new DotNodeConfig (true , true ), runtimeDotConfig ));
@@ -313,6 +304,25 @@ private boolean isCousinEdge(
313
304
return twoDegreesOfSeparation && (allCousins .contains (participantA ) || allCousins .contains (participantB ));
314
305
}
315
306
307
+ /**
308
+ * Directly connect the loose ends to the title of the 2nd degree of
309
+ * separation tables.
310
+ */
311
+ private void connectLooseEnds (
312
+ final Set <Edge > allCousinEdges ,
313
+ final Set <Table > allCousins ,
314
+ final Set <Table > relatedTables
315
+ ) {
316
+ for (Edge edge : allCousinEdges ) {
317
+ if (this .isCousinTable (edge .getParentTable (), allCousins , relatedTables )) {
318
+ edge .connectToParentTitle ();
319
+ }
320
+ if (this .isCousinTable (edge .getChildTable (), allCousins , relatedTables )) {
321
+ edge .connectToChildTitle ();
322
+ }
323
+ }
324
+ }
325
+
316
326
private boolean isCousinTable (
317
327
final Table candidate ,
318
328
final Set <Table > allCousins ,
0 commit comments