Class DBRelationshipNTO

  • All Implemented Interfaces:
    com.im.df.api.support.DFNewTypeOptions, com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationship, com.im.df.api.support.DFNewTypeWellKnownOptions.SingleDFItem
    Direct Known Subclasses:
    DBRelationshipMtoNNTO, DBRelationshipSimpleNTO

    public abstract class DBRelationshipNTO
    extends com.chemaxon.dif.db.api.item.newtype.SingleDFItemNTO<com.im.df.api.ddl.DFRelationship>
    implements com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationship
    Author:
    svata
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected com.im.df.api.ddl.DFRelationship.Type relType  
      • Fields inherited from interface com.im.df.api.support.DFNewTypeOptions

        PROP_ERROR_MESSAGE, PROP_VALID
      • Fields inherited from interface com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationship

        PROP_CREATE_FOREIGN_KEY, PROP_DEST_FIELD, PROP_REL_TYPE, PROP_SRC_FIELD
      • Fields inherited from interface com.im.df.api.support.DFNewTypeWellKnownOptions.SingleDFItem

        PROP_DESCRIPTION, PROP_NEW_DFITEM_NAME
    • Constructor Summary

      Constructors 
      Constructor Description
      DBRelationshipNTO​(com.im.df.api.ddl.DFContainer<com.im.df.api.ddl.DFRelationship> parentContainer, boolean canChangeRelType)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canChangeRelType()  
      protected com.im.commons.db.util.SchemaQualifiedName[] getConstraintNames​(List<? extends com.im.df.api.ddl.DFEntity> entities)
      Returns constraint names for entities end for previously processed entities.
      com.im.df.api.ddl.DFField getDstField()  
      com.im.df.api.ddl.DFRelationship.Type getRelType()  
      com.chemaxon.dif.db.api.schema.DBSchemaImpl getSchema()  
      com.im.df.api.ddl.DFField getSrcField()  
      boolean isCreateConstraints()  
      protected boolean isFKRequired​(boolean source, com.im.df.api.ddl.DFField fld)  
      protected void notifyCreateConstraintsChanged()  
      protected void notifyFieldChanged​(boolean source, com.im.df.api.ddl.DFField field)  
      protected void notifyFKNameChanged​(com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationshipFK fk)  
      void setCreateConstraints​(boolean createForeignKey)  
      void setDstField​(com.im.df.api.ddl.DFField dstField)  
      protected void setFKNameSafe​(com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationshipFK fk, com.im.commons.db.util.SchemaQualifiedName name)  
      void setRelType​(com.im.df.api.ddl.DFRelationship.Type relType)  
      void setSrcField​(com.im.df.api.ddl.DFField srcField)  
      protected void updateKeyValidators()  
      protected void updateStatus()  
      • Methods inherited from class com.chemaxon.dif.db.api.item.newtype.SingleDFItemNTO

        getDescription, getNewDFItemName, getParentContainer, normalizeDFItemName, notifyNewDFItemNameChanged, setDescription, setNewDFItemName, setNewDFItemNameSafe
      • Methods inherited from class com.chemaxon.dif.db.api.item.newtype.AbstractNTOImpl

        addPropertyChangeListener, firePropertyChange, getErrorMessage, isValid, removePropertyChangeListener, setErrorMessage, setValid
      • Methods inherited from interface com.im.df.api.support.DFNewTypeOptions

        addPropertyChangeListener, getErrorMessage, isValid, removePropertyChangeListener
      • Methods inherited from interface com.im.df.api.support.DFNewTypeWellKnownOptions.SingleDFItem

        getDescription, getNewDFItemName, setDescription, setNewDFItemName, setNewDFItemNameSafe
    • Field Detail

      • relType

        protected com.im.df.api.ddl.DFRelationship.Type relType
    • Constructor Detail

      • DBRelationshipNTO

        public DBRelationshipNTO​(com.im.df.api.ddl.DFContainer<com.im.df.api.ddl.DFRelationship> parentContainer,
                                 boolean canChangeRelType)
    • Method Detail

      • getSchema

        public com.chemaxon.dif.db.api.schema.DBSchemaImpl getSchema()
      • isFKRequired

        protected boolean isFKRequired​(boolean source,
                                       com.im.df.api.ddl.DFField fld)
      • updateStatus

        protected void updateStatus()
        Overrides:
        updateStatus in class com.chemaxon.dif.db.api.item.newtype.SingleDFItemNTO<com.im.df.api.ddl.DFRelationship>
      • updateKeyValidators

        protected void updateKeyValidators()
      • getConstraintNames

        protected com.im.commons.db.util.SchemaQualifiedName[] getConstraintNames​(List<? extends com.im.df.api.ddl.DFEntity> entities)
        Returns constraint names for entities end for previously processed entities.
        Parameters:
        entities -
        Returns:
        constraint names
        Throws:
        IllegalStateException - if entities contains null.
      • getSrcField

        public com.im.df.api.ddl.DFField getSrcField()
        Specified by:
        getSrcField in interface com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationship
      • setSrcField

        public void setSrcField​(com.im.df.api.ddl.DFField srcField)
        Specified by:
        setSrcField in interface com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationship
      • getDstField

        public com.im.df.api.ddl.DFField getDstField()
        Specified by:
        getDstField in interface com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationship
      • setDstField

        public void setDstField​(com.im.df.api.ddl.DFField dstField)
        Specified by:
        setDstField in interface com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationship
      • notifyFieldChanged

        protected void notifyFieldChanged​(boolean source,
                                          com.im.df.api.ddl.DFField field)
      • isCreateConstraints

        public boolean isCreateConstraints()
        Specified by:
        isCreateConstraints in interface com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationship
      • setCreateConstraints

        public void setCreateConstraints​(boolean createForeignKey)
        Specified by:
        setCreateConstraints in interface com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationship
      • notifyCreateConstraintsChanged

        protected void notifyCreateConstraintsChanged()
      • getRelType

        public com.im.df.api.ddl.DFRelationship.Type getRelType()
        Specified by:
        getRelType in interface com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationship
      • setRelType

        public void setRelType​(com.im.df.api.ddl.DFRelationship.Type relType)
        Specified by:
        setRelType in interface com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationship
      • canChangeRelType

        public boolean canChangeRelType()
      • setFKNameSafe

        protected void setFKNameSafe​(com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationshipFK fk,
                                     com.im.commons.db.util.SchemaQualifiedName name)
      • notifyFKNameChanged

        protected void notifyFKNameChanged​(com.im.df.api.support.DFNewTypeWellKnownOptions.NewRelationshipFK fk)