@SuppressWarnings("OptionalGetWithoutIsPresent") private EdgeLabel createEdgeLabel( final String edgeLabelName, final VertexLabel outVertexLabel, final VertexLabel inVertexLabel, final Map<String, PropertyType> columns, final ListOrderedSet<String> identifiers) { Preconditions.checkArgument(this.topology.isSqlWriteLockHeldByCurrentThread(), "Lock must be held by the thread to call createEdgeLabel"); Preconditions.checkArgument(!edgeLabelName.startsWith(EDGE_PREFIX), "edgeLabelName may not start with " + EDGE_PREFIX); Preconditions.checkState(!this.isSqlgSchema(), "createEdgeLabel may not be called for \"%s\"", SQLG_SCHEMA); Schema inVertexSchema = inVertexLabel.getSchema(); //Edge may not already exist. Preconditions.checkState(!getEdgeLabel(edgeLabelName).isPresent(), "BUG: Edge \"%s\" already exists!", edgeLabelName); SchemaTable foreignKeyOut = SchemaTable.of(this.name, outVertexLabel.getLabel()); SchemaTable foreignKeyIn = SchemaTable.of(inVertexSchema.name, inVertexLabel.getLabel()); TopologyManager.addEdgeLabel(this.sqlgGraph, this.getName(), EDGE_PREFIX + edgeLabelName, foreignKeyOut, foreignKeyIn, columns, identifiers); if (this.sqlgGraph.getSqlDialect().needsSchemaCreationPrecommit()) { try { this.sqlgGraph.tx().getConnection().commit(); } catch (SQLException e) { throw new RuntimeException(e); } } return outVertexLabel.addEdgeLabel(edgeLabelName, inVertexLabel, columns, identifiers); }
ListOrderedSet<String> identifiers) { addEdgeLabel(sqlgGraph, schema, prefixedTable, foreignKeyOut, foreignKeyIn, columns, identifiers, PartitionType.NONE, null);
@SuppressWarnings("OptionalGetWithoutIsPresent") private EdgeLabel createEdgeLabel( final String edgeLabelName, final VertexLabel outVertexLabel, final VertexLabel inVertexLabel, final Map<String, PropertyType> columns, final ListOrderedSet<String> identifiers) { Preconditions.checkArgument(this.topology.isSqlWriteLockHeldByCurrentThread(), "Lock must be held by the thread to call createEdgeLabel"); Preconditions.checkArgument(!edgeLabelName.startsWith(EDGE_PREFIX), "edgeLabelName may not start with " + EDGE_PREFIX); Preconditions.checkState(!this.isSqlgSchema(), "createEdgeLabel may not be called for \"%s\"", SQLG_SCHEMA); Schema inVertexSchema = inVertexLabel.getSchema(); //Edge may not already exist. Preconditions.checkState(!getEdgeLabel(edgeLabelName).isPresent(), "BUG: Edge \"%s\" already exists!", edgeLabelName); SchemaTable foreignKeyOut = SchemaTable.of(this.name, outVertexLabel.getLabel()); SchemaTable foreignKeyIn = SchemaTable.of(inVertexSchema.name, inVertexLabel.getLabel()); TopologyManager.addEdgeLabel(this.sqlgGraph, this.getName(), EDGE_PREFIX + edgeLabelName, foreignKeyOut, foreignKeyIn, columns, identifiers); if (this.sqlgGraph.getSqlDialect().needsSchemaCreationPrecommit()) { try { this.sqlgGraph.tx().getConnection().commit(); } catch (SQLException e) { throw new RuntimeException(e); } } return outVertexLabel.addEdgeLabel(edgeLabelName, inVertexLabel, columns, identifiers); }
ListOrderedSet<String> identifiers) { addEdgeLabel(sqlgGraph, schema, prefixedTable, foreignKeyOut, foreignKeyIn, columns, identifiers, PartitionType.NONE, null);
SchemaTable foreignKeyIn = SchemaTable.of(inVertexSchema.name, inVertexLabel.getLabel()); TopologyManager.addEdgeLabel( this.sqlgGraph, this.getName(),
String partitionExpression) { Vertex edgeVertex = addEdgeLabel(sqlgGraph, prefixedTable, columns, identifiers, partitionType, partitionExpression);
String partitionExpression) { Vertex edgeVertex = addEdgeLabel(sqlgGraph, prefixedTable, columns, identifiers, partitionType, partitionExpression);
SchemaTable foreignKeyIn = SchemaTable.of(inVertexSchema.name, inVertexLabel.getLabel()); TopologyManager.addEdgeLabel( this.sqlgGraph, this.getName(),
Vertex edgeVertex; if (hasIDPrimaryKey(primaryKeys)) { edgeVertex = TopologyManager.addEdgeLabel(this.sqlgGraph, table, Collections.emptyMap(), new ListOrderedSet<>(), PartitionType.NONE, null); } else { edgeVertex = TopologyManager.addEdgeLabel(this.sqlgGraph, table, Collections.emptyMap(), identifiers, PartitionType.NONE, null); } else { edgeVertex = TopologyManager.addEdgeLabel(this.sqlgGraph, table, Collections.emptyMap(), ListOrderedSet.listOrderedSet(primaryKeys), PartitionType.NONE, null);
Vertex edgeVertex; if (hasIDPrimaryKey(primaryKeys)) { edgeVertex = TopologyManager.addEdgeLabel(this.sqlgGraph, table, Collections.emptyMap(), new ListOrderedSet<>(), PartitionType.NONE, null); } else { edgeVertex = TopologyManager.addEdgeLabel(this.sqlgGraph, table, Collections.emptyMap(), identifiers, PartitionType.NONE, null); } else { edgeVertex = TopologyManager.addEdgeLabel(this.sqlgGraph, table, Collections.emptyMap(), ListOrderedSet.listOrderedSet(primaryKeys), PartitionType.NONE, null);