Class RelationshipDefinition

java.lang.Object
ch.so.agi.filegdb.write.RelationshipDefinition

public final class RelationshipDefinition extends Object
Definition of a relationship class to create.

 RelationshipDefinition.builder("building_entrance")
     .originClass("building").destinationClass("entrance")
     .cardinality(ONE_TO_MANY)
     .originPrimaryKey("globalid")
     .originForeignKey("building_id")
     .forwardLabel("entrances").backwardLabel("building")
     .build();
 
  • Constructor Details

    • RelationshipDefinition

      public RelationshipDefinition(String name, String originClassName, String destinationClassName, RelationshipCardinality cardinality, String originPrimaryKey, String originForeignKey, String destinationPrimaryKey, String destinationForeignKey, String forwardLabel, String backwardLabel, boolean composite)
    • RelationshipDefinition

      public RelationshipDefinition(String name, String originClassName, String destinationClassName, RelationshipCardinality cardinality, String originPrimaryKey, String originForeignKey, String destinationPrimaryKey, String destinationForeignKey, String forwardLabel, String backwardLabel, boolean composite, String mappingTable, boolean attributed)
      Creates a relationship definition.
      Parameters:
      mappingTable - existing table used as n:m mapping table; when set, no mapping table is created and the relationship name must equal the table name (as expected by GDAL/ArcGIS)
      attributed - whether the relationship class is attributed (n:m with attributes)
  • Method Details

    • name

      public String name()
    • originClassName

      public String originClassName()
    • destinationClassName

      public String destinationClassName()
    • cardinality

      public RelationshipCardinality cardinality()
    • originPrimaryKey

      public String originPrimaryKey()
    • originForeignKey

      public String originForeignKey()
    • destinationPrimaryKey

      public String destinationPrimaryKey()
    • destinationForeignKey

      public String destinationForeignKey()
    • forwardLabel

      public String forwardLabel()
    • backwardLabel

      public String backwardLabel()
    • composite

      public boolean composite()
    • mappingTable

      public String mappingTable()
      Existing table used as n:m mapping table, or null when filegdb4j creates it.
    • attributed

      public boolean attributed()
      Whether the relationship class is attributed (n:m with attribute columns).
    • builder

      public static RelationshipDefinition.Builder builder(String name)
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public final String toString()
      Overrides:
      toString in class Object