Package io.inversion

Class Relationship

  • All Implemented Interfaces:
    java.io.Serializable

    public final class Relationship
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Field Detail

      • REL_ONE_TO_ONE_PARENT

        public static final java.lang.String REL_ONE_TO_ONE_PARENT
        See Also:
        Constant Field Values
      • REL_ONE_TO_ONE_CHILD

        public static final java.lang.String REL_ONE_TO_ONE_CHILD
        See Also:
        Constant Field Values
      • REL_MANY_TO_MANY

        public static final java.lang.String REL_MANY_TO_MANY
        See Also:
        Constant Field Values
      • name

        protected java.lang.String name
      • type

        protected java.lang.String type
      • fkIndex1

        protected Index fkIndex1
      • fkIndex2

        protected Index fkIndex2
      • exclude

        protected boolean exclude
    • Constructor Detail

      • Relationship

        public Relationship()
      • Relationship

        public Relationship​(java.lang.String name,
                            java.lang.String type,
                            Collection collection,
                            Collection related,
                            Index fkIndex1,
                            Index fkIndex2)
    • Method Detail

      • isExclude

        public boolean isExclude()
      • withExclude

        public Relationship withExclude​(boolean exclude)
      • getCollection

        public Collection getCollection()
        Returns:
        the collection
      • getRelated

        public Collection getRelated()
        Returns:
        the related
      • withRelated

        public Relationship withRelated​(Collection related)
        Parameters:
        related - the related to set
        Returns:
        this
      • isManyToMany

        public boolean isManyToMany()
      • isOneToMany

        public boolean isOneToMany()
      • isManyToOne

        public boolean isManyToOne()
      • isOneToOneParent

        public boolean isOneToOneParent()
      • isOneToOneChild

        public boolean isOneToOneChild()
      • getName

        public java.lang.String getName()
        Returns:
        the name
      • withName

        public Relationship withName​(java.lang.String name)
        Parameters:
        name - the name to set
        Returns:
        this
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getType

        public java.lang.String getType()
        Returns:
        the type
      • withType

        public Relationship withType​(java.lang.String type)
        Parameters:
        type - the type to set
        Returns:
        this
      • getFkIndex1

        public Index getFkIndex1()
      • getFkIndex2

        public Index getFkIndex2()
      • getPrimaryKeyTable1

        public Collection getPrimaryKeyTable1()
      • getFk1Col1

        public Property getFk1Col1()
        Returns:
        the fkCol1
      • getFk2Col1

        public Property getFk2Col1()
        Returns:
        the fkCol2
      • buildPrimaryKeyFromForeignKey

        public java.util.Map<java.lang.String,​java.lang.Object> buildPrimaryKeyFromForeignKey​(java.util.Map<java.lang.String,​java.lang.Object> foreignKey)
      • buildForeignKeyFromPrimaryKey

        public java.util.Map<java.lang.String,​java.lang.Object> buildForeignKeyFromPrimaryKey​(java.util.Map<java.lang.String,​java.lang.Object> primaryKey)