com.corticon.eclipse.studio.vocabulary.core

## Class JoinExpression

- java.lang.Object
- - com.corticon.eclipse.studio.vocabulary.core.JoinExpression

-     public class JoinExpression
      extends java.lang.Object

  JoinExpression represents a string join expression in a structured form. It is essentially a container for a number of JoinReference instances. This class offers several convenient queries intended to support the CDO builder.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `JoinExpression.ParserMessage`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `REFERENCE_SEPARATOR` Separator between LHS and RHS of join reference.
    `static java.lang.String` | `TABLE_COLUMN_SEPARATOR` Separator between table name and column name.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JoinExpression(java.lang.String astrJoinExpression)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `format()` Transform this join expression into a string.
    `java.lang.String` | `formatInverse()` Format and return the inverse join expression, namely the join expression needed to traverse from target-to-source.
    `java.lang.String` | `getIntersectionTable()` Returns the intersection table, only applicable in many-to-many relationships.
    `java.util.Set<java.lang.String>` | `getInverseJoinColumnNames()` Returns a list of Inverse Join Column names.
    `java.util.Map<java.lang.String,java.lang.String>` | `getInverseJoinColumnNamesMap()` Returns a map of Inverse Join Column names.
    `java.util.Set<java.lang.String>` | `getJoinColumnNames()` Returns a list of Join Column names.
    `java.util.Map<java.lang.String,java.lang.String>` | `getJoinColumnNamesMap()` Returns a map of Join Column names.
    `java.util.Map<java.lang.String,java.lang.String>` | `getJoinColumnNamesMapForOneToMany()` Returns a map of Join Column names for associations without an intersection tables.
    `JoinReference` | `getJoinReference(int aiJoinReferenceIndex)` Get the specified join reference.
    `int` | `getJoinReferenceCount()` Return the number of join references.
    `java.util.List<JoinExpression.ParserMessage>` | `getParserMessages()` Return the list of parser messages generated.
    `java.util.Set<java.lang.String>` | `getSourceColumnNames()` Returns a list of Source Table column names.
    `java.lang.String` | `getSourceTable()` Returns the "first" table, namely the "leftmost" table in the join expression.
    `java.util.Set<java.lang.String>` | `getTargetColumnNames()` Returns a list of Target Table column names.
    `java.lang.String` | `getTargetTable()` Returns the "target" table, namely the "rightmost" table in the join expression.
    `boolean` | `isValid()` Return `true` if this JoinExpression is valid (i.e., has no parser messages).
    `void` | `postMessage(java.lang.String astrKey, java.lang.String[] astrArray)` Add a message to the list.

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

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

- - ### Field Detail

    - #### REFERENCE_SEPARATOR

          public static final java.lang.String REFERENCE_SEPARATOR

      Separator between LHS and RHS of join reference.
      See Also:
        Constant Field Values

    - #### TABLE_COLUMN_SEPARATOR

          public static final java.lang.String TABLE_COLUMN_SEPARATOR

      Separator between table name and column name.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JoinExpression

          public JoinExpression(java.lang.String astrJoinExpression)

  - ### Method Detail

    - #### getParserMessages

          public java.util.List<JoinExpression.ParserMessage> getParserMessages()

      Return the list of parser messages generated.
      Returns:
        List of parser messages.

    - #### format

          public java.lang.String format()

      Transform this join expression into a string.
      Returns:
        Formatted join expression.

    - #### formatInverse

          public java.lang.String formatInverse()

      Format and return the inverse join expression, namely the join expression needed to traverse from target-to-source.
      Returns:
        Target-to-source join expression.

    - #### isValid

          public boolean isValid()

      Return `true` if this JoinExpression is valid (i.e., has no parser messages).
      Returns:
        `true` if this JoinExpression instance is valid.

    - #### getSourceTable

          public java.lang.String getSourceTable()

      Returns the "first" table, namely the "leftmost" table in the join expression.
      Returns:
        Source table name.

    - #### getTargetTable

          public java.lang.String getTargetTable()

      Returns the "target" table, namely the "rightmost" table in the join expression.
      Returns:
        Target table name.

    - #### getIntersectionTable

          public java.lang.String getIntersectionTable()

      Returns the intersection table, only applicable in many-to-many relationships.
      Returns:
        Center table name or `null` if not a many-to-many join expression.

    - #### getJoinColumnNames

          public java.util.Set<java.lang.String> getJoinColumnNames()

      Returns a list of Join Column names. Only applicable if an intersection table is specified, this will be a list of all foreign key column names that "point" to the source table.
      Returns:
        List of join column names or `null`.

    - #### getJoinColumnNamesMap

          public java.util.Map<java.lang.String,java.lang.String> getJoinColumnNamesMap()

      Returns a map of Join Column names. Only applicable if an intersection table is specified, this will be a map with the target column names as keys and the source column names as values.
      Returns:
        Map of target->source column names or `null`.

    - #### getJoinColumnNamesMapForOneToMany

          public java.util.Map<java.lang.String,java.lang.String> getJoinColumnNamesMapForOneToMany()

      Returns a map of Join Column names for associations without an intersection tables.
      Returns:
        Map of target->source column names or `null`.

    - #### getInverseJoinColumnNames

          public java.util.Set<java.lang.String> getInverseJoinColumnNames()

      Returns a list of Inverse Join Column names. Only applicable if an intersection table is specified, this will be a list of all foreign key column names that "point" to the target table.
      Returns:
        List of join column names or `null`.

    - #### getInverseJoinColumnNamesMap

          public java.util.Map<java.lang.String,java.lang.String> getInverseJoinColumnNamesMap()

      Returns a map of Inverse Join Column names. Only applicable if an intersection table is specified, this will be a map with the source column names as keys and target column names as values table.
      Returns:
        Map of surcel->target column names or `null`.

    - #### getSourceColumnNames

          public java.util.Set<java.lang.String> getSourceColumnNames()

      Returns a list of Source Table column names.
      Returns:
        List of column names or `null`.

    - #### getTargetColumnNames

          public java.util.Set<java.lang.String> getTargetColumnNames()

      Returns a list of Target Table column names.
      Returns:
        List of column names or `null`.

    - #### postMessage

          public void postMessage(java.lang.String astrKey,
                         java.lang.String[] astrArray)

      Add a message to the list.
      Parameters:
        `astrKey` - Bundle key of message.
        `astrArray` - Array of variables.

    - #### getJoinReference

          public JoinReference getJoinReference(int aiJoinReferenceIndex)

      Get the specified join reference.
      Parameters:
        `aiJoinReferenceIndex` - Index of join reference.
      Returns:
        JoinReference Join Reference instance.

    - #### getJoinReferenceCount

          public int getJoinReferenceCount()

      Return the number of join references.
      Returns:
        Number of join references.

Copyright © 2005-2013 Progress Software Corporation and/or its subsidiaries and affiliates. All rights reserved.