Class PersistableJoinTable

  • All Implemented Interfaces:
    Table, org.datanucleus.store.schema.table.Table

    public class PersistableJoinTable
    extends JoinTable
    Representation of a join table for the case where we have an N-1 unidirectional relation stored in a join table. It's a minority interest situation, but worth inclusion. The "owner" in this case is the side with the relation (the "N" side). The "related" is the other side.
    • Field Detail

      • ownerTable

        protected Table ownerTable
        Table of the owner of this member.
      • relatedMapping

        protected JavaTypeMapping relatedMapping
        Mapping from the join table to the "related". This will be a PersistableMapping.
    • Constructor Detail

      • PersistableJoinTable

        public PersistableJoinTable​(Table ownerTable,
                                    DatastoreIdentifier tableName,
                                    org.datanucleus.metadata.AbstractMemberMetaData mmd,
                                    RDBMSStoreManager storeMgr)
        Constructor.
        Parameters:
        ownerTable - Table of the owner of this member.
        tableName - The Table SQL identifier
        mmd - Member meta data for the "element" member.
        storeMgr - Manager for the datastore.
    • Method Detail

      • getMemberMapping

        public JavaTypeMapping getMemberMapping​(org.datanucleus.metadata.AbstractMemberMetaData mmd)
        Description copied from interface: Table
        Accessor for the mapping for the specified FieldMetaData. A datastore container object may store many fields.
        Parameters:
        mmd - Metadata for the field/property
        Returns:
        The Mapping for the member, or null if the FieldMetaData cannot be found
      • initialize

        public void initialize​(org.datanucleus.ClassLoaderResolver clr)
        Description copied from interface: Table
        Method to initialise the table.
        Parameters:
        clr - The ClassLoaderResolver
      • getExpectedForeignKeys

        public List<ForeignKey> getExpectedForeignKeys​(org.datanucleus.ClassLoaderResolver clr)
        Accessor for the expected foreign keys for this table.
        Overrides:
        getExpectedForeignKeys in class TableImpl
        Parameters:
        clr - The ClassLoaderResolver
        Returns:
        The expected foreign keys.
      • getExpectedIndices

        protected Set<Index> getExpectedIndices​(org.datanucleus.ClassLoaderResolver clr)
        Accessor for the indices for this table. This includes both the user-defined indices (via MetaData), and the ones required by foreign keys (required by relationships).
        Overrides:
        getExpectedIndices in class TableImpl
        Parameters:
        clr - The ClassLoaderResolver
        Returns:
        The indices
      • getRelatedMapping

        public JavaTypeMapping getRelatedMapping()
        Accessor for the mapping of the "related" in the join table.
        Returns:
        The column mapping for the related side.