docs.RepoObject_Plantuml_Entity - V

type: V ( view ), modify_date: 2021-11-28 10:58:40

RepoObject_guid: BCD49D8D-4595-EB11-84F4-A81E8446D5B0

Description

Examples

Entity Diagram

entity-docs.repoobject_plantuml_entity

Columns

Table 1. Columns of docs.RepoObject_Plantuml_Entity - V
PK Column Name Data Type NULL? ID

nvarchar(10)

NOT NULL

nvarchar(257)

NOT NULL

uniqueidentifier

NOT NULL

nvarchar(max)

NOT NULL

nvarchar(max)

NOT NULL

nvarchar(max)

NOT NULL

nvarchar(max)

NOT NULL

nvarchar(max)

NOT NULL

nvarchar(max)

NOT NULL

nvarchar(128)

NOT NULL

Foreign Key Diagram

entity_1_1_fk-docs.repoobject_plantuml_entity

References

Object Reference Diagram - 1 1

entity_1_1_objectref-docs.repoobject_plantuml_entity

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-docs.repoobject_plantuml_entity

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-docs.repoobject_plantuml_entity

Column Reference Diagram

entity_1_1_colref-docs.repoobject_plantuml_entity

Indexes

idx_RepoObject_Plantuml_Entity__1

idx_RepoObject_Plantuml_Entity__2

idx_RepoObject_Plantuml_Entity__3

Column Details

_

cultures_name

cultures_name

nvarchar(10)

NOT NULL

RepoObject_fullname2

RepoObject_fullname2

nvarchar(257)

NOT NULL

Description

(concat([RepoObject_schema_name],'.',[RepoObject_name]))


RepoObject_guid

RepoObject_guid

uniqueidentifier

NOT NULL

RepoObject_Puml

RepoObject_Puml

nvarchar(max)

NOT NULL

RepoObject_PumlOnlyIndex

RepoObject_PumlOnlyIndex

nvarchar(max)

NOT NULL

RepoObject_PumlOnlyPK

RepoObject_PumlOnlyPK

nvarchar(max)

NOT NULL

RepoObject_PumlOnlyPkOrIndex

RepoObject_PumlOnlyPkOrIndex

nvarchar(max)

NOT NULL

RepoObject_PumlOnlyPkOrIndexOrMeasure

RepoObject_PumlOnlyPkOrIndexOrMeasure

nvarchar(max)

NOT NULL

RepoObject_PumlOnlyPkOrNotHidden

RepoObject_PumlOnlyPkOrNotHidden

nvarchar(max)

NOT NULL

RepoObject_schema_name

RepoObject_schema_name

nvarchar(128)

NOT NULL

sql_modules_definition

docs.RepoObject_Plantuml_Entity - V script
/*
PlantUML definition per RepoObject
to be used in composed PlantUML diagrams

you need to persist:
EXEC [docs].[usp_PERSIST_RepoObject_Plantuml_Entity_T]

it is possible to create interactive SVG diagrams.
But they need to be inline, and big diagrams will not match and it will not be possible to open them in a separate window

Code should be like
entity "[[{site-url}/{page-component-name}/{page-component-version}/{page-module}/config.Parameter.html config.Parameter]]" as config.Parameter << U >> {

But maybe this could be hard coded instead of using inline and parameters? At least to use the "current" version?
page-component-name and page-module could also be hard coded,
but what about the {site-url}?

entity "[[{site-url}/{page-component-name}/current/{page-module}/config.Parameter.html config.Parameter]]" as config.Parameter << U >> {


*/
CREATE View docs.RepoObject_Plantuml_Entity
As
Select
    ro.RepoObject_guid
  , ro.cultures_name
  , RepoObject_Puml                       =
  --
  Concat (
             ro.PumlEntityTopDefault
           , ' {'
           , Char ( 13 ) + Char ( 10 )
           , collist.PlantumlAllEntityColumns

           --, collist.PlantumlPkEntityColumns
           --, Iif(ro.tables_isHidden = 1, '  ..', '  --')
           --, Char ( 13 ) + Char ( 10 )
           --, collist.PlantumlNonPkEntityColumns
           --, Iif(ro.tables_isHidden = 1, '  ..', '  --')
           --, Char ( 13 ) + Char ( 10 )
           --, collist.PlantumlNonPkHiddenEntityColumns
           , Iif(ro.tables_isHidden = 1, '  ..', '  --')
           , Char ( 13 ) + Char ( 10 )
           , mlist.PlantumlMeasures
           , '}'
           , Char ( 13 ) + Char ( 10 )
         )
  , RepoObject_PumlOnlyPK                 =
  --
  Concat (
             ro.PumlEntityTopDefault
           , ' {'
           , Char ( 13 ) + Char ( 10 )
           , collist.PlantumlPkEntityColumns
           , Iif(ro.tables_isHidden = 1, '  ..', '  --')
           , Char ( 13 ) + Char ( 10 )
           , '}'
           , Char ( 13 ) + Char ( 10 )
         )
  , RepoObject_PumlOnlyPkOrNotHidden      =
  --
  Concat (
             ro.PumlEntityTopDefault
           , ' {'
           , Char ( 13 ) + Char ( 10 )
           , collist.PlantumlPkEntityColumns
           , Iif(ro.tables_isHidden = 1, '  ..', '  --')
           , Char ( 13 ) + Char ( 10 )
           , collist.PlantumlNonPkEntityColumns
           , Iif(ro.tables_isHidden = 1, '  ..', '  --')
           , Char ( 13 ) + Char ( 10 )
           , '}'
           , Char ( 13 ) + Char ( 10 )
         )
  , RepoObject_PumlOnlyPkOrIndex          =
  --
  Concat (
             ro.PumlEntityTopDefault
           , ' {'
           , Char ( 13 ) + Char ( 10 )
           , collist.PlantumlPkEntityColumns
           , Iif(ro.tables_isHidden = 1, '  ..', '  --')
           , Char ( 13 ) + Char ( 10 )
           , collist.PlantumlNonPkIndexColumns
           , Iif(ro.tables_isHidden = 1, '  ..', '  --')
           , Char ( 13 ) + Char ( 10 )
           , '}'
           , Char ( 13 ) + Char ( 10 )
         )
  , RepoObject_PumlOnlyPkOrIndexOrMeasure =
  --
  Concat (
             ro.PumlEntityTopWorkaround
           , ' {'
           , Char ( 13 ) + Char ( 10 )
           , collist.PlantumlPkEntityColumns
           , Iif(ro.tables_isHidden = 1, '  ..', '  --')
           , Char ( 13 ) + Char ( 10 )
           , collist.PlantumlNonPkIndexColumns
           , Iif(ro.tables_isHidden = 1, '  ..', '  --')
           , Char ( 13 ) + Char ( 10 )
           , mlist.PlantumlMeasures
           , '}'
           , Char ( 13 ) + Char ( 10 )
         )
  , RepoObject_PumlOnlyIndex              =
  --
  Concat (
             ro.PumlEntityTopDefault
           , ' {'
           , Char ( 13 ) + Char ( 10 )
           , indexlist.PumlIndexList
           , Char ( 13 ) + Char ( 10 )
           , '}'
           , Char ( 13 ) + Char ( 10 )
         )
  , ro.RepoObject_fullname2
  , ro.RepoObject_schema_name
From
    docs.RepoObject_OutputFilter_T   As ro
    Left Join
        docs.RepoObject_ColumnList_T As collist
            On
            collist.RepoObject_guid           = ro.RepoObject_guid
            And
            (
                (
                    collist.is_external       = 0
                    And collist.cultures_name = ro.cultures_name
                )
                Or
                --external objects are without culture
                (
                    collist.is_external       = 1
                    And collist.cultures_name = ''
                )
            )

    Left Join
        docs.RepoObject_IndexList_T  As indexlist
            On
            indexlist.RepoObject_guid         = ro.RepoObject_guid
            And indexlist.cultures_name       = ro.cultures_name

    Left Join
        docs.RepoObject_MeasureList  As mlist
            On
            mlist.RepoObject_guid             = ro.RepoObject_guid
            And mlist.cultures_name           = ro.cultures_name