82 lines
2.4 KiB
Plaintext
82 lines
2.4 KiB
Plaintext
## -----------------------------------------------------------------------
|
|
## Basic link from entity A to entity B
|
|
#macro( links $entitiesList )
|
|
## Links relations
|
|
#foreach( $entity in $entitiesList )
|
|
#foreach( $link in $entity.selectedLinks )
|
|
#set($cardinality = "1" )
|
|
#if ( $link.isCollectionType() )
|
|
#set($cardinality = "N" )
|
|
#end
|
|
$entity.name --> "$cardinality" $link.targetEntity.name
|
|
#end
|
|
#end
|
|
#end
|
|
## -----------------------------------------------------------------------
|
|
## Link from "entity field" to another entity
|
|
#macro( linksFromFields $entitiesList )
|
|
#foreach( $entity in $entitiesList )
|
|
#foreach( $link in $entity.selectedLinks )
|
|
#set($cardinality = "1" )
|
|
#if ( $link.isCollectionType() )
|
|
#set($cardinality = "N" )
|
|
#end
|
|
${entity.name}::${link.fieldName} --> "$cardinality" $link.targetEntity.name
|
|
#end
|
|
#end
|
|
#end
|
|
## -----------------------------------------------------------------------
|
|
#macro( basicLink $entity $link $cardinality )
|
|
$entity.name --> "$cardinality" $link.targetEntity.name
|
|
#end
|
|
## -----------------------------------------------------------------------
|
|
#macro( linkFromField $entity $link $cardinality )
|
|
${entity.name}::${link.fieldName} --> "$cardinality" $link.targetEntity.name
|
|
#end
|
|
## -----------------------------------------------------------------------
|
|
@startuml
|
|
|
|
## --- Model description note
|
|
note as TelosysDiagramTitleNote
|
|
Model <b>$model.name</b>
|
|
generated by <b>Telosys</b>
|
|
$now.date ( $now.time )
|
|
end note
|
|
|
|
## --- Classes (based on model entities)
|
|
#foreach( $entity in $selectedEntities )
|
|
class $entity.name #if ( $entity.isJoinEntity() ) << (J,AliceBlue) Join Entity >> #else << (E,cornsilk) >> #end {
|
|
#foreach( $attribute in $entity.keyAttributes )
|
|
+ $attribute.name : $attribute.neutralType {PK} #if ($attribute.isFK() ){FK}#end
|
|
|
|
#end
|
|
....
|
|
#foreach( $attribute in $entity.nonKeyAttributes )
|
|
+ $attribute.name : $attribute.neutralType #if ($attribute.isFK() ){FK}#end
|
|
|
|
#end
|
|
....
|
|
#foreach( $link in $entity.selectedLinks )
|
|
+ $link.fieldName : $link.fieldType
|
|
#end
|
|
}
|
|
#end
|
|
|
|
## --- Links between classes
|
|
## Choose link type here :
|
|
## #links ( $selectedEntities )
|
|
## #linksFromFields( $selectedEntities )
|
|
#foreach( $entity in $selectedEntities )
|
|
#foreach( $link in $entity.selectedLinks )
|
|
#set($cardinality = "1" )
|
|
#if ( $link.isCollectionType() )
|
|
#set($cardinality = "N" )
|
|
#end
|
|
## Choose link type here :
|
|
## #basicLink( $entity, $link, $cardinality )
|
|
#linkFromField( $entity, $link, $cardinality )
|
|
#end
|
|
#end
|
|
|
|
@enduml
|