Class PartitionedIdBuilder

  • All Implemented Interfaces:
    IdBuilder<oracle.pgx.common.PartitionedId,​PartitionedIdBuilder.WithTableName>

    @BetaApi
    public class PartitionedIdBuilder
    extends java.lang.Object
    implements IdBuilder<oracle.pgx.common.PartitionedId,​PartitionedIdBuilder.WithTableName>
    A builder for partitioned IDs for a specific graph. Use PartitionedIdBuilderFactory.newId() to obtain an instance of this class.

    To build a PartitionedId, first provide the table/provider name using withTableName(String). Then, specify a value for each key column of the provider.

    For example, assume a provider called Person with two key columns called first_name and last_name, both of type STRING:

    
     PartitionedIdBuilderFactory idFactory = PartitionedIdBuilderFactory.forGraph(myGraph);
     PartitionedId id = idFactory.newId(). // Get instance of this builder class
         withTableName("Person").          // Specify table name
         withKeyValue("first_name", "Joanne").
         withKeyValue("last_name", "Doe"). // Specify key column values
         build();                          // Build the final ID.
     // Build more IDs, if needed
     PartitionedId anotherId = idFactory.newId()...
     

    The PartitionedIdBuilder.WithTableName.withKeyValue(String, Object) function will fail, if either the key column does not exist for the table or the provided key value has the wrong type. The PartitionedIdBuilder.WithTableName.build() function will fail, if the ID is incomplete, i.e., if there is at least one key column for which no key value was provided.

    Since:
    25.2.0