Skip to content

Latest commit

 

History

History
82 lines (56 loc) · 2.11 KB

File metadata and controls

82 lines (56 loc) · 2.11 KB

<-- previous rule | overview | next rule -->

Break before ASSOCIATIONs

Standardizes line breaks and indentation of ASSOCIATIONs.

Options

  • Break before keywords: [Always]
  • Indent if breaking: [2]
  • Break before data source: [Never]
  • Indent if breaking: [2]
  • Break before condition: [If view contains multi-line condition]
  • Indent if breaking: [4]
  • Break before default filter: [Always]
  • Indent if breaking: [4]

Examples

define view entity C_AnyEntity
  as select from I_AnyEntity as AnyAlias

    left outer to one join I_OtherEntity as OtherAlias
      on AnyAlias.IdField = OtherAlias.IdField

  association [0..1] to I_FourthEntity as _Fourth on  $projection.IdField = _Fourth.IdField
                                                  and _Fourth.CondField   = 'X'

  association of many
  to many I_FifthEntity as _Fifth on  $projection.IdField    = _Fifth.IdField
                                  and $projection.SubIdField = _Fifth.SubIdField

{
  key AnyAlias.IdField,
  key OtherAlias.SubIdField,

      OtherAlias.AnyNonKeyField,
      OtherAlias.OtherNonKeyField,

      _Fourth,
      _Fifth
}

Resulting code:

define view entity C_AnyEntity
  as select from I_AnyEntity as AnyAlias

    left outer to one join I_OtherEntity as OtherAlias
      on AnyAlias.IdField = OtherAlias.IdField

  association [0..1] to I_FourthEntity as _Fourth
    on  $projection.IdField = _Fourth.IdField
    and _Fourth.CondField   = 'X'

  association of many to many I_FifthEntity as _Fifth
    on  $projection.IdField    = _Fifth.IdField
    and $projection.SubIdField = _Fifth.SubIdField

{
  key AnyAlias.IdField,
  key OtherAlias.SubIdField,

      OtherAlias.AnyNonKeyField,
      OtherAlias.OtherNonKeyField,

      _Fourth,
      _Fifth
}

Related code