Menu

[r19]: / trunk / etc / sql2java.cfg.xsd  Maximize  Restore  History

Download this file

352 lines (321 with data), 13.5 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : sql2java.cfg.xsd
Created on : June 11, 2007, 12:45 PM
Author : dge2
Description:
Purpose of XML Schema document follows.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="sql2java.sf.net" targetNamespace="sql2java.sf.net">
<!-- ====================================================================== -->
<!-- == Root == -->
<!-- ====================================================================== -->
<!--
- The main configuration element. All others will be a child of this
- element.
-->
<xs:element name="sql2java" type="Sql2JavaType" />
<xs:complexType name="Sql2JavaType">
<xs:sequence>
<!--
- Import other configuration files.
-->
<xs:element ref="import" minOccurs="0" maxOccurs="unbounded" />
<!--
- The database configuration.
-->
<xs:element ref="database" minOccurs="1" maxOccurs="1" />
<!--
- The generator configuration.
-->
<xs:element ref="generation" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<!-- ====================================================================== -->
<!-- == Imports == -->
<!-- ====================================================================== -->
<!--
- Import other configuration files.
-->
<xs:element name="import">
<xs:complexType>
<xs:attribute name="resource" type="xs:string" />
</xs:complexType>
</xs:element>
<!-- ====================================================================== -->
<!-- == Database == -->
<!-- ====================================================================== -->
<!--
- The database configuration.
-
- This element will hold the database configuration. This means
- information about the driver, user and password as well as the
- connection DSN. It doesn't matter which sequence the sub-elements occur,
- they just need to be there.
-->
<xs:element name="database" >
<xs:complexType>
<xs:all>
<!--
- The driver class name.
-
- This element will hold the name of the driver to use. This will
- be the JDBC driver class.
-->
<xs:element name="driverClass" type="xs:string" />
<!--
- The connection URL.
-
- This element will define how we need to connect to the database.
- It will contain a prefix followed by the hostname and some sort
- database identification. This is however not always true. Some
- database engines will use a totally different connection url.
- if this is the case, check the database's JDBC driver
- information.
-->
<xs:element name="url" type="xs:string" />
<!--
- The username.
-->
<xs:element name="username" type="xs:string" />
<!--
- The password matching the username.
-->
<xs:element name="password" type="xs:string" />
<!--
- How to fetch the relations?
-->
<xs:element ref="relations" />
<!--
- How and when to get the nextvalue
-->
<xs:element ref="sequence" />
</xs:all>
</xs:complexType>
</xs:element>
<!--
- How to fetch the relations?
-
- We have different ways to fetch the relationships between tables. We
- can do this using Sql JDBC metadata. However there are some JDBC driver
- implementations which don't have decent metadata implementations. To
- support these databases and to let the user define relationships when
- there are none, we'll also let the user create an XML file holding the
- relationship definitions.
-
- This element will have two attributes. The attribute 'type' will define
- which type of relationship fetching we want, being 'sql' or 'xml'. The
- second attribute is only used when using XML as a fetching strategy. It
- will define the file which holds the relationship definitions.
-->
<xs:element name="relations" >
<xs:complexType>
<!--
- The relationship fetching strategy.
-
- This can be one of 'sql' or 'xml'.
-->
<xs:attribute name="source">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="sql" />
<xs:enumeration value="xml" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<!--
- The path to the XML relationship definition file.
-
- This attribute is only used when type equals XML. It will define
- the path to the relationship definition file.
-->
<xs:attribute name="resource" type="xs:string" />
</xs:complexType>
</xs:element>
<!--
- How do we fetch a sequence?
-
- When creating a new record in the database, we'll need to know it's
- sequence.
-
- There are two types of sequence fetching. The firstone expects us to set
- the sequence, then insert the record. This is the most simple one
- because we'll have the sequence set on our object and inside the
- database.
-
- The second way of setting the sequence is somehow different. The
- database engine will set our sequence, so we'll need to perform a select
- to get to know our sequence.
-->
<xs:element name="sequence" >
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="timing">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="before" />
<xs:enumeration value="after" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<!-- ====================================================================== -->
<!-- == Generator == -->
<!-- ====================================================================== -->
<!--
- The generator configuration.
-
- We need to define where to generate our result to. This means we need to
- know where to store the result. We also need to know which tables,
- schema's and columns we need to include during our generation. Both
- things can be done by defining the right data inside the 'target' and
- 'includes' elements.
-
- We also might want to include extra columns. These extra columns don't
- need to exist inside the database, but might be needed to perform
- lookups. An example of this is PostgreSQL's OID column. Some projects
- use this column to perform lookups.
-
- We also need to know which templates to use during generation. A
- collection of templates is called a feature. By defining these features
- we'll be able to define which technologies we want to use in our result.
-->
<xs:element name="generation" >
<xs:complexType>
<xs:all>
<!--
- Where do we need to store the result?
-->
<xs:element ref="target" />
<!--
- Which schema's, table's or columns do we need to include?
-->
<xs:element ref="includes" />
<!--
- Which extra columns do we need to include during generation?
-->
<xs:element ref="columns" />
<!--
- Which features will we use?
-->
<xs:element ref="features" />
</xs:all>
</xs:complexType>
</xs:element>
<!--
- Where do we need to store the result?
-
- We need to define where we want to store our generated code. We also
- need to know in which package we need to generate the code.
-->
<xs:element name="target" >
<xs:complexType>
<xs:all>
<xs:element name="package" type="xs:string" />
<xs:element name="path" type="xs:string" />
</xs:all>
</xs:complexType>
</xs:element>
<!--
- Which schema's, table's or columns do we need to include?
-
- We need to know for which types we are looking for. Should we only look
- for tables, or should we need to look at views too?
-
- After we have defined which types we need to look at, we may define a
- pattern to look for. This will make it possible to look for table
- starting with 'my_' or some other prefix.
-->
<xs:element name="includes" >
<xs:complexType>
<xs:sequence>
<xs:element ref="pattern" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="type" minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!--
- Which patterns are we looking for?
-
- After we have defined which types we need to look at, we may define a
- pattern to look for. This will make it possible to look for table
- starting with 'my_' or some other prefix.
-->
<xs:element name="pattern" >
<xs:complexType>
<xs:attribute name="type" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="schema" />
<xs:enumeration value="table" />
<xs:enumeration value="column" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="value" type="xs:string" />
</xs:complexType>
</xs:element>
<!--
- Which types are we looking at?
-
- We need to know for which types we are looking for. Should we only look
- for tables, or should we need to look at views too?
-->
<xs:element name="type">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="TABLE" />
<xs:enumeration value="VIEW" />
<xs:enumeration value="SYSTEM TABLE" />
<xs:enumeration value="GLOBAL TEMPORARY" />
<xs:enumeration value="LOCAL TEMPORARY" />
<xs:enumeration value="ALIAS" />
<xs:enumeration value="SYNONYM" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<!--
- Which extra columns do we want?
-
- We also might want to include extra columns. These extra columns don't
- need to exist inside the database, but might be needed to perform
- lookups. An example of this is PostgreSQL's OID column. Some projects
- use this column to perform lookups.
-->
<xs:element name="columns" >
<xs:complexType>
<xs:sequence>
<xs:element ref="column" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="column">
<xs:complexType>
<xs:attribute name="type" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="schema" />
<xs:enumeration value="table" />
<xs:enumeration value="column" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="value" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="features" >
<xs:complexType>
<xs:sequence>
<xs:element name="feature" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="resource" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.