-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathFmxSQLTable.class.st
More file actions
212 lines (164 loc) · 4.7 KB
/
FmxSQLTable.class.st
File metadata and controls
212 lines (164 loc) · 4.7 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
"
I represent a Table in the relational model.
"
Class {
#name : #FmxSQLTable,
#superclass : #FmxSQLStructuralEntity,
#traits : 'FmxSQLAbstractType + FmxSQLColumnsContainer',
#classTraits : 'FmxSQLAbstractType classTrait + FmxSQLColumnsContainer classTrait',
#instVars : [
'#constraints => FMMany type: #FmxSQLConstraint opposite: #table',
'#superTable => FMOne type: #FmxSQLTable opposite: #subTables',
'#subTables => FMMany type: #FmxSQLTable opposite: #superTable',
'#references => FMMany type: #FmxSQLTableReference opposite: #table',
'#triggers => FMMany type: #FmxSQLTrigger opposite: #table',
'#updateQueries => FMMany type: #FmxSQLUpdateQuery opposite: #table'
],
#category : #'FamixNGSQL-Entities'
}
{ #category : #meta }
FmxSQLTable class >> annotation [
<MSEClass: #Table super: #FmxSQLStructuralEntity>
<package: #FamixNGSQL>
<generated>
^self
]
{ #category : #adding }
FmxSQLTable >> addConstraints: anObject [
<generated>
^ self constraints add: anObject
]
{ #category : #adding }
FmxSQLTable >> addTriggers: anObject [
<generated>
^ self triggers add: anObject
]
{ #category : #accessing }
FmxSQLTable >> checkConstraints [
^ self constraintsSatisfying: [ :c | c class = FmxSQLCheckConstraint ]
]
{ #category : #accessing }
FmxSQLTable >> columnsWithUniqueConstraint [
^ ((self constraintsSatisfying: [ :c | c isUniqueConstraint ])
flatCollect: [ :c | (c queryOutgoing: FmxSQLColumnReference) collect: #column ]) asSet asArray
]
{ #category : #accessing }
FmxSQLTable >> conceptId [
^ self conceptIdIfAbsent: [ self error: 'Table has no concept.' ]
]
{ #category : #accessing }
FmxSQLTable >> conceptIdIfAbsent: aBlock [
^ self privateState attributeAt: #concept ifAbsent: aBlock
]
{ #category : #accessing }
FmxSQLTable >> constraints [
"Relation named: #constraints type: #FmxSQLConstraint opposite: #table"
<generated>
^ constraints
]
{ #category : #accessing }
FmxSQLTable >> constraints: anObject [
<generated>
constraints value: anObject
]
{ #category : #navigation }
FmxSQLTable >> constraintsGroup [
<generated>
<navigation: 'Constraints'>
^ MooseGroup withAll: self constraints asSet
]
{ #category : #accessing }
FmxSQLTable >> constraintsSatisfying: aBlock [
^ self constraints select: aBlock
]
{ #category : #accessing }
FmxSQLTable >> exclusionConstraints [
^ self constraintsSatisfying: [ :c | c class = FmxSQLExclusionConstraint ]
]
{ #category : #accessing }
FmxSQLTable >> foreignKeyConstraints [
^ self constraintsSatisfying: [ :c | c class = FmxSQLForeignKeyConstraint ]
]
{ #category : #testing }
FmxSQLTable >> hasSuperTable [
^ self superTable isNotNil
]
{ #category : #accessing }
FmxSQLTable >> incomingForeignKeyConstraints [
^ ((self columns
select: [ :c | c hasUniqueConstraint or: [ c hasPrimaryKey ] ])
flatCollect: [ :c | c foreignKeyConstraintsReferencing collect: #from ]) asSet asArray
]
{ #category : #accessing }
FmxSQLTable >> notNullConstraints [
^ self constraintsSatisfying: [ :c | c class = FmxSQLNotNullConstraint ]
]
{ #category : #accessing }
FmxSQLTable >> primaryKeyConstraints [
^ self constraintsSatisfying: [ :c | c class = FmxSQLPrimaryKeyConstraint ]
]
{ #category : #accessing }
FmxSQLTable >> references [
"Relation named: #references type: #FmxSQLTableReference opposite: #table"
<generated>
^ references
]
{ #category : #accessing }
FmxSQLTable >> references: anObject [
<generated>
references value: anObject
]
{ #category : #accessing }
FmxSQLTable >> subTables [
"Relation named: #subTables type: #FmxSQLTable opposite: #superTable"
<generated>
^ subTables
]
{ #category : #accessing }
FmxSQLTable >> subTables: anObject [
<generated>
subTables value: anObject
]
{ #category : #accessing }
FmxSQLTable >> superTable [
"Relation named: #superTable type: #FmxSQLTable opposite: #subTables"
<generated>
^ superTable
]
{ #category : #accessing }
FmxSQLTable >> superTable: anObject [
<generated>
superTable := anObject
]
{ #category : #accessing }
FmxSQLTable >> triggers [
"Relation named: #triggers type: #FmxSQLTrigger opposite: #table"
<generated>
^ triggers
]
{ #category : #accessing }
FmxSQLTable >> triggers: anObject [
<generated>
triggers value: anObject
]
{ #category : #navigation }
FmxSQLTable >> triggersGroup [
<generated>
<navigation: 'Triggers'>
^ MooseGroup withAll: self triggers asSet
]
{ #category : #accessing }
FmxSQLTable >> uniqueConstraints [
^ self constraintsSatisfying: [ :c | c class = FmxSQLUniqueConstraint ]
]
{ #category : #accessing }
FmxSQLTable >> updateQueries [
"Relation named: #updateQueries type: #FmxSQLUpdateQuery opposite: #table"
<generated>
^ updateQueries
]
{ #category : #accessing }
FmxSQLTable >> updateQueries: anObject [
<generated>
updateQueries value: anObject
]