Package org.apache.cayenne.map

## Class DbJoin

- java.lang.Object
- - org.apache.cayenne.map.DbJoin

- All Implemented Interfaces:
    `Serializable`, `XMLSerializable`

      public class DbJoin
      extends Object
      implements XMLSerializable, Serializable

  Defines a join between two attributes of a given relationship.
  Since:
    1.1
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected DbRelationship` | `relationship` |
    `protected String` | `sourceName` |
    `protected String` | `targetName` |

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `DbJoin()` |
    `` | `DbJoin​(DbRelationship relationship)` |
    `` | `DbJoin​(DbRelationship relationship, String sourceName, String targetName)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `DbJoin` | `createReverseJoin()` | Returns a "reverse" join.
    `void` | `encodeAsXML​(XMLEncoder encoder, ConfigurationNodeVisitor delegate)` | Prints itself as XML to the provided XMLEncoder.
    `DbRelationship` | `getRelationship()` |
    `DbAttribute` | `getSource()` | Returns DbAttribute on on the left side of the join.
    `String` | `getSourceName()` |
    `DbAttribute` | `getTarget()` |
    `String` | `getTargetName()` |
    `void` | `setRelationship​(DbRelationship relationship)` |
    `void` | `setSourceName​(String string)` |
    `void` | `setTargetName​(String string)` |
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### relationship

          protected DbRelationship relationship

    - #### sourceName

          protected String sourceName

    - #### targetName

          protected String targetName

  - ### Constructor Detail

    - #### DbJoin

          protected DbJoin()

    - #### DbJoin

          public DbJoin​(DbRelationship relationship)

    - #### DbJoin

          public DbJoin​(DbRelationship relationship,
                        String sourceName,
                        String targetName)

  - ### Method Detail

    - #### createReverseJoin

          public DbJoin createReverseJoin()

      Returns a "reverse" join. Join source relationship is not set and must be initialized by the caller.

    - #### getSource

          public DbAttribute getSource()

      Returns DbAttribute on on the left side of the join.

    - #### getTarget

          public DbAttribute getTarget()

    - #### encodeAsXML

          public void encodeAsXML​(XMLEncoder encoder,
                                  ConfigurationNodeVisitor delegate)

      Prints itself as XML to the provided XMLEncoder.
      Specified by:
        `encodeAsXML` in interface `XMLSerializable`

    - #### getRelationship

          public DbRelationship getRelationship()

    - #### getSourceName

          public String getSourceName()

    - #### getTargetName

          public String getTargetName()

    - #### setRelationship

          public void setRelationship​(DbRelationship relationship)

    - #### setSourceName

          public void setSourceName​(String string)

    - #### setTargetName

          public void setTargetName​(String string)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`