Skip to content

Commit de65af5

Browse files
authored
Merge pull request #111: Metastorm: cover inner and outer keys in relations
2 parents 250c5b5 + f6735fa commit de65af5

File tree

3 files changed

+184
-6
lines changed

3 files changed

+184
-6
lines changed

resources/annotated.meta-storm.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<meta-storm xmlns="meta-storm">
33
<definitions>
4+
<!-- Embeddable Entity -->
45
<classConstructor class="\Cycle\Annotated\Annotation\Embeddable" argument="0">
56
<collection name="cycle/orm:entity-class" argument="0" />
67
<collection name="cycle/orm:entity-role" argument="0" />
78
</classConstructor>
89

10+
<!-- Foreign Key -->
11+
<!-- target: -->
912
<classConstructor class="\Cycle\Annotated\Annotation\ForeignKey" argument="0">
1013
<collection name="cycle/orm:entity-class" argument="0" />
1114
<collection name="cycle/orm:entity-role" argument="0" />
1215
</classConstructor>
16+
<!-- innerKey: -->
17+
<classConstructor class="\Cycle\Annotated\Annotation\ForeignKey" argument="1" targetInArray="value">
18+
<properties xpath="$containingClass">
19+
<filters>
20+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
21+
</filters>
22+
</properties>
23+
</classConstructor>
24+
<!-- outerKey: -->
25+
<classConstructor class="\Cycle\Annotated\Annotation\ForeignKey" argument="2" targetInArray="value">
26+
<properties xpath="$argument[0]">
27+
<filters>
28+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
29+
</filters>
30+
</properties>
31+
</classConstructor>
1332
</definitions>
1433
</meta-storm>

resources/relations.meta-storm.xml

Lines changed: 165 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,100 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<meta-storm xmlns="meta-storm">
33
<definitions>
4+
<!-- Belongs To -->
5+
<!-- target: -->
46
<classConstructor class="\Cycle\Annotated\Annotation\Relation\BelongsTo" argument="0">
57
<collection name="cycle/orm:entity-class" argument="0" />
68
<collection name="cycle/orm:entity-role" argument="0" />
79
</classConstructor>
10+
<!-- innerKey: -->
11+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\BelongsTo" argument="1" targetInArray="value">
12+
<properties xpath="$containingClass">
13+
<filters>
14+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
15+
</filters>
16+
</properties>
17+
</classConstructor>
18+
<!-- outerKey: -->
19+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\BelongsTo" argument="2" targetInArray="value">
20+
<properties xpath="$argument[0]">
21+
<filters>
22+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
23+
</filters>
24+
</properties>
25+
</classConstructor>
826

27+
<!-- Has Many -->
28+
<!-- target: -->
929
<classConstructor class="\Cycle\Annotated\Annotation\Relation\HasMany" argument="0">
1030
<collection name="cycle/orm:entity-class" argument="0" />
1131
<collection name="cycle/orm:entity-role" argument="0" />
1232
</classConstructor>
33+
<!-- innerKey: -->
34+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\HasMany" argument="1" targetInArray="value">
35+
<properties xpath="$containingClass">
36+
<filters>
37+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
38+
</filters>
39+
</properties>
40+
</classConstructor>
41+
<!-- outerKey: -->
42+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\HasMany" argument="2" targetInArray="value">
43+
<properties xpath="$argument[0]">
44+
<filters>
45+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
46+
</filters>
47+
</properties>
48+
</classConstructor>
1349

50+
<!-- Has One -->
51+
<!-- target: -->
1452
<classConstructor class="\Cycle\Annotated\Annotation\Relation\HasOne" argument="0">
1553
<collection name="cycle/orm:entity-class" argument="0" />
1654
<collection name="cycle/orm:entity-role" argument="0" />
1755
</classConstructor>
56+
<!-- innerKey: -->
57+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\HasOne" argument="1" targetInArray="value">
58+
<properties xpath="$containingClass">
59+
<filters>
60+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
61+
</filters>
62+
</properties>
63+
</classConstructor>
64+
<!-- outerKey: -->
65+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\HasOne" argument="2" targetInArray="value">
66+
<properties xpath="$argument[0]">
67+
<filters>
68+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
69+
</filters>
70+
</properties>
71+
</classConstructor>
1872

73+
<!-- Refers To -->
74+
<!-- target: -->
1975
<classConstructor class="\Cycle\Annotated\Annotation\Relation\RefersTo" argument="0">
2076
<collection name="cycle/orm:entity-class" argument="0" />
2177
<collection name="cycle/orm:entity-role" argument="0" />
2278
</classConstructor>
79+
<!-- innerKey: -->
80+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\RefersTo" argument="1" targetInArray="value">
81+
<properties xpath="$containingClass">
82+
<filters>
83+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
84+
</filters>
85+
</properties>
86+
</classConstructor>
87+
<!-- outerKey: -->
88+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\RefersTo" argument="2" targetInArray="value">
89+
<properties xpath="$argument[0]">
90+
<filters>
91+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
92+
</filters>
93+
</properties>
94+
</classConstructor>
2395

96+
<!-- Many To Many -->
97+
<!-- target: -->
2498
<classConstructor class="\Cycle\Annotated\Annotation\Relation\ManyToMany" argument="0">
2599
<collection name="cycle/orm:entity-class" argument="0" />
26100
<collection name="cycle/orm:entity-role" argument="0" />
@@ -29,22 +103,110 @@
29103
<collection name="cycle/orm:entity-class" argument="0" />
30104
<collection name="cycle/orm:entity-role" argument="0" />
31105
</classConstructor>
106+
<!-- target innerKey: -->
107+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\ManyToMany" argument="2" targetInArray="value">
108+
<properties xpath="$containingClass">
109+
<filters>
110+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
111+
</filters>
112+
</properties>
113+
</classConstructor>
114+
<!-- target outerKey: -->
115+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\ManyToMany" argument="3" targetInArray="value">
116+
<properties xpath="$argument[0]">
117+
<filters>
118+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
119+
</filters>
120+
</properties>
121+
</classConstructor>
122+
<!-- through innerKey: -->
123+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\ManyToMany" argument="4" targetInArray="value">
124+
<properties xpath="$argument[1]">
125+
<filters>
126+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
127+
</filters>
128+
</properties>
129+
</classConstructor>
130+
<!-- through outerKey: -->
131+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\ManyToMany" argument="5" targetInArray="value">
132+
<properties xpath="$argument[1]">
133+
<filters>
134+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
135+
</filters>
136+
</properties>
137+
</classConstructor>
32138

33-
<classConstructor class="\Cycle\Annotated\Annotation\Relation\BelongsToMorphed" argument="1">
139+
<!-- Belongs To Morphed -->
140+
<!-- target: -->
141+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\Morphed\BelongsToMorphed" argument="1">
34142
<collection name="cycle/orm:entity-class" argument="0" />
35143
<collection name="cycle/orm:entity-role" argument="0" />
36144
</classConstructor>
145+
<!-- innerKey: -->
146+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\Morphed\BelongsToMorphed" argument="1" targetInArray="value">
147+
<properties xpath="$containingClass">
148+
<filters>
149+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
150+
</filters>
151+
</properties>
152+
</classConstructor>
153+
<!-- outerKey: -->
154+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\Morphed\BelongsToMorphed" argument="2" targetInArray="value">
155+
<properties xpath="$argument[0]">
156+
<filters>
157+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
158+
</filters>
159+
</properties>
160+
</classConstructor>
37161

38-
<classConstructor class="\Cycle\Annotated\Annotation\Relation\MorphedHasMany" argument="1">
162+
<!-- Morphed Has Many -->
163+
<!-- target: -->
164+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\Morphed\MorphedHasMany" argument="1">
39165
<collection name="cycle/orm:entity-class" argument="0" />
40166
<collection name="cycle/orm:entity-role" argument="0" />
41167
</classConstructor>
168+
<!-- innerKey: -->
169+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\Morphed\MorphedHasMany" argument="1" targetInArray="value">
170+
<properties xpath="$containingClass">
171+
<filters>
172+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
173+
</filters>
174+
</properties>
175+
</classConstructor>
176+
<!-- outerKey: -->
177+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\Morphed\MorphedHasMany" argument="2" targetInArray="value">
178+
<properties xpath="$argument[0]">
179+
<filters>
180+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
181+
</filters>
182+
</properties>
183+
</classConstructor>
42184

43-
<classConstructor class="\Cycle\Annotated\Annotation\Relation\MorphedHasOne" argument="1">
185+
<!-- Morphed Has One -->
186+
<!-- target: -->
187+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\Morphed\MorphedHasOne" argument="1">
44188
<collection name="cycle/orm:entity-class" argument="0" />
45189
<collection name="cycle/orm:entity-role" argument="0" />
46190
</classConstructor>
191+
<!-- innerKey: -->
192+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\Morphed\MorphedHasOne" argument="1" targetInArray="value">
193+
<properties xpath="$containingClass">
194+
<filters>
195+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
196+
</filters>
197+
</properties>
198+
</classConstructor>
199+
<!-- outerKey: -->
200+
<classConstructor class="\Cycle\Annotated\Annotation\Relation\Morphed\MorphedHasOne" argument="2" targetInArray="value">
201+
<properties xpath="$argument[0]">
202+
<filters>
203+
<hasAttribute class="\Cycle\Annotated\Annotation\Column"/>
204+
</filters>
205+
</properties>
206+
</classConstructor>
47207

208+
<!-- Embedded -->
209+
<!-- target: -->
48210
<classConstructor class="\Cycle\Annotated\Annotation\Relation\Embedded" argument="0">
49211
<collection name="cycle/orm:entity-embeddable-class" argument="0" />
50212
</classConstructor>

tests/docker-compose.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ version: "3"
33
services:
44
sqlserver:
55
image: mcr.microsoft.com/mssql/server:2019-latest
6-
restart: always
76
ports:
87
- "11433:1433"
98
environment:
@@ -12,7 +11,6 @@ services:
1211

1312
mysql_latest:
1413
image: mysql:8.0
15-
restart: always
1614
command: --default-authentication-plugin=mysql_native_password
1715
ports:
1816
- "13306:3306"
@@ -23,7 +21,6 @@ services:
2321

2422
postgres:
2523
image: postgres:12
26-
restart: always
2724
ports:
2825
- "15432:5432"
2926
environment:

0 commit comments

Comments
 (0)