-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClassesSample.puml
47 lines (41 loc) · 1.08 KB
/
ClassesSample.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@startuml (id=tableA)
class tableA <<entity>> {
+ id : T {PK}
+ attribute1 :T {required}
+ attribute2 :T
+...
}
@enduml
@startuml (id=tableB)
class tableB <<entity>> {
+ id1 : T {PK}
+ id2 : T {PK}
+ attribute1 :T
+ attribute2 :integer {constraint = "value >0"}
+ attribute3 :integer
+...
}
@enduml
@startuml (id=tableC)
class tableC <<entity>> {
+ id :T {PK}
+ attribute1 :T {required}
}
@enduml
@startuml (id=tableD)
class tableD <<entity>> {
+ id :T {unique}
+ attribute1 :T {required}
}
@enduml
@startuml (id=relations)
!procedure $relations($class1, $class2)
!if ($class1=="tableA" && $class2=="tableB") || ($class1=="tableB" && $class2=="tableA")
tableA -- tableB :tableA.id = tableB.id1
!elseif ($class1=="tableA" && $class2=="tableC") || ($class1=="tableC" && $class2=="tableA")
tableA -- tableC :tableA.attribute2 = tableC.id
!elseif ($class1=="tableB" && $class2=="tableD") || ($class1=="tableD" && $class2=="tableB")
tableB -- tableD :tableB.attribute1 = tableD.id
!endif
!endprocedure
@enduml