Class JoinTable

All Implemented Interfaces:
Table, org.datanucleus.store.schema.table.Table
Direct Known Subclasses:
ElementContainerTable, MapTable, PersistableJoinTable

public abstract class JoinTable extends TableImpl
Abstract class representing a field that maps to a table in the datastore. This will be something like an SCO, such as Set, Map, List where a link table is used. It could potentially be used where the user wants to map some field into its own SCO table.
  • Field Details

    • ownerTable

      protected final Table ownerTable
      Table of the owner of the member represented here.
    • mmd

      protected final org.datanucleus.metadata.AbstractMemberMetaData mmd
      MetaData for the field/property in the owner class.
    • ownerMapping

      protected JavaTypeMapping ownerMapping
      Mapping of owner column(s) back to the owner table PK.
    • ownerType

      protected final String ownerType
      Object type of the owner.
  • Constructor Details

    • JoinTable

      protected JoinTable(Table ownerTable, DatastoreIdentifier tableName, org.datanucleus.metadata.AbstractMemberMetaData mmd, RDBMSStoreManager storeMgr)
      Constructor.
      Parameters:
      ownerTable - Table of the owner member, for linking back
      tableName - The Table SQL identifier
      mmd - Member meta data for the owner field/property
      storeMgr - Manager for the datastore.
  • Method Details

    • getOwnerTable

      public Table getOwnerTable()
    • getPrimaryKey

      public PrimaryKey getPrimaryKey()
      Accessor for the primary key for this table. Overrides the method in TableImpl to add on any specification of PK name in the <join> metadata.
      Overrides:
      getPrimaryKey in class TableImpl
      Returns:
      The primary key.
    • requiresPrimaryKey

      protected boolean requiresPrimaryKey()
      Convenience method for whether a PK is required for the join table. Makes use of the extension "primary-key" (within <field> or <join>) to allow turning off PK generation.
      Returns:
      Whether a PK is required
    • getOwnerMapping

      public JavaTypeMapping getOwnerMapping()
      Accessor for the "owner" mapping end of the relationship. This will be the primary key of the owner table.
      Returns:
      The column mapping for the owner.
    • getOwnerMemberMetaData

      public org.datanucleus.metadata.AbstractMemberMetaData getOwnerMemberMetaData()
      Accessor for the MetaData for the owner field/property for this container.
      Returns:
      metadata for the owning field/property
    • getIdMapping

      public JavaTypeMapping getIdMapping()
      Accessor for a mapping for the ID (persistable) for this table. This is not supported by join tables since they don't represent FCOs.
      Returns:
      The (persistable) ID mapping.