Skip to content

Latest commit

 

History

History
77 lines (52 loc) · 1.93 KB

DdlPositionJoinRule.md

File metadata and controls

77 lines (52 loc) · 1.93 KB

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

Break before JOINs

Standardizes line breaks and indentation of JOINs.

Options

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

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

  left outer to one
  join I_ThirdEntity as ThirdAlias
  on  AnyAlias.IdField      = ThirdAlias.IdField
  and OtherAlias.SubIdField = ThirdAlias.SubIdField

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

{
  key AnyAlias.IdField,
  key ThirdAlias.SubIdField,

      OtherAlias.AnyNonKeyField,
      ThirdAlias.OtherNonKeyField,

      _Fourth
}

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

    left outer to one join I_ThirdEntity as ThirdAlias
      on  AnyAlias.IdField      = ThirdAlias.IdField
      and OtherAlias.SubIdField = ThirdAlias.SubIdField

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

{
  key AnyAlias.IdField,
  key ThirdAlias.SubIdField,

      OtherAlias.AnyNonKeyField,
      ThirdAlias.OtherNonKeyField,

      _Fourth
}

Related code