docs.RepoObject_Plantuml_ObjectRefList_30_0 - V

type: V ( view ), modify_date: 2022-09-19 12:23:44

RepoObject_guid: B2C70217-619D-EB11-84F6-A81E8446D5B0

Description

Examples

Entity Diagram

entity-docs.repoobject_plantuml_objectreflist_30_0

Columns

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

1

uniqueidentifier

NOT NULL

nvarchar(max)

NULL

Foreign Key Diagram

entity_1_1_fk-docs.repoobject_plantuml_objectreflist_30_0

References

Referencing Objects

Object Reference Diagram - 1 1

entity_1_1_objectref-docs.repoobject_plantuml_objectreflist_30_0

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-docs.repoobject_plantuml_objectreflist_30_0

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-docs.repoobject_plantuml_objectreflist_30_0

Column Reference Diagram

entity_1_1_colref-docs.repoobject_plantuml_objectreflist_30_0

Indexes

PK_RepoObject_Plantuml_ObjectRefList_30_0

Column Details

_

RepoObject_guid

1

RepoObject_guid

uniqueidentifier

NOT NULL

ObjectRefList

ObjectRefList

nvarchar(max)

NULL

sql_modules_definition

docs.RepoObject_Plantuml_ObjectRefList_30_0 - V script
CREATE View docs.RepoObject_Plantuml_ObjectRefList_30_0
As
Select
    ro.RepoObject_guid
  --, cultures_name = Cast('' As NVarchar(10))
  --, ro.RepoObject_fullname2
  , ObjectRefList = String_Agg (
                                   Concat (
                                              Cast(N'' As NVarchar(Max))
                                            , objectref.referenced_puml_entity
                                            , ' <.. '
                                            , objectref.referencing_puml_entity
                                          )
                                 , Char ( 13 ) + Char ( 10 )
                               ) Within Group(Order By
                                                  objectref.referenced_puml_entity
                                                , objectref.referencing_puml_entity)
From
--select all objects pairs that have any reference relation inside the reference path with ro.RepoObject_guid (in the desired direction)
(
    --Select
    --    ro.RepoObject_guid
    --  , ro.RepoObject_fullname2
    --  , T1.Node_guid As Node_guid_1
    --  , T2.Node_guid As Node_guid_2
    --From
    --    repo.RepoObject                                                                     As ro
    --    Cross Apply [reference].ftv_RepoObject_ReferencedReferencing ( ro.RepoObject_guid, 30, 0 ) As T1
    --    Cross Apply [reference].ftv_RepoObject_ReferencedReferencing ( ro.RepoObject_guid, 30, 0 ) As T2
    Select
        Distinct
        RepoObject_guid
      --,[RepoObject_fullname2]
      , Referencing_guid
      , Referenced_guid
    From
        reference.RepoObject_ReferenceTree
    Where
        Referenced_Depth      <= 30
        And Referencing_Depth = 0
)     As ro
    Inner Join
    --only direct relations between pre-selected objects
    --maybe not required
    (
        --Select
        --    Object1.RepoObject_fullname2 As Referencing_ro_fullname2
        --  , Object1.RepoObject_guid      As Referencing_ro_guid
        --  , Object2.RepoObject_fullname2 As Referenced_ro_fullname2
        --  , Object2.RepoObject_guid      As Referenced_ro_guid
        --From
        --    graph.RepoObject As Object1
        --  , graph.ReferencedObject As referenced
        --  , graph.RepoObject As Object2
        --Where Match(
        --    Object1-(referenced)->Object2)
        Select
            Referenced_ro_guid     = referenced_RepoObject_guid
          , referenced_puml_entity
          , Referencing_ro_guid    = referencing_RepoObject_guid
          , referencing_puml_entity
        From
            reference.RepoObject_reference_T
    ) As objectref
        On
        objectref.Referencing_ro_guid    = ro.Referencing_guid
        And objectref.Referenced_ro_guid = ro.Referenced_guid
Group By
    ro.RepoObject_guid