~raginggoblin/infolog/infolog

« back to all changes in this revision

Viewing changes to InfologServer/lib/hibernate-distribution-3.3.2.GA/project/documentation/manual/src/main/docbook/fr-FR/content/association_mapping.po

  • Committer: Raging Goblin
  • Date: 2013-11-16 16:51:32 UTC
  • Revision ID: raging_goblin-20131116165132-weujnptzc88uy4ah
Mavenized the project, now using shared project InfologSync

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
msgid ""
2
 
msgstr ""
3
 
"Project-Id-Version: PACKAGE VERSION\n"
4
 
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
5
 
"POT-Creation-Date: 2009-06-10 21:02+0000\n"
6
 
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
7
 
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
 
"Language-Team: LANGUAGE <LL@li.org>\n"
9
 
"MIME-Version: 1.0\n"
10
 
"Content-Type: text/plain; charset=UTF-8\n"
11
 
"Content-Transfer-Encoding: 8bit\n"
12
 
 
13
 
#. Tag: title
14
 
#: association_mapping.xml:30
15
 
#, no-c-format
16
 
msgid "Association Mappings"
17
 
msgstr "Mapper les associations"
18
 
 
19
 
#. Tag: title
20
 
#: association_mapping.xml:33
21
 
#, no-c-format
22
 
msgid "Introduction"
23
 
msgstr "Introduction"
24
 
 
25
 
#. Tag: para
26
 
#: association_mapping.xml:35
27
 
#, fuzzy, no-c-format
28
 
msgid ""
29
 
"Association mappings are often the most difficult thing to implement "
30
 
"correctly. In this section we examine some canonical cases one by one, "
31
 
"starting with unidirectional mappings and then bidirectional cases. We will "
32
 
"use <literal>Person</literal> and <literal>Address</literal> in all the "
33
 
"examples."
34
 
msgstr ""
35
 
"Correctement mapper les associations est souvent la tâche la plus difficile. "
36
 
"Dans cette section nous traiterons les cas classiques les uns après les "
37
 
"autres. Nous commencerons d'abbord par les mappings unidirectionnels, puis "
38
 
"nous aborderons la question des mappings bidirectionnels. Nous illustrerons "
39
 
"tous nos exemples avec les classes <literal>Person</literal> et "
40
 
"<literal>Address</literal>."
41
 
 
42
 
#. Tag: para
43
 
#: association_mapping.xml:43
44
 
#, fuzzy, no-c-format
45
 
msgid ""
46
 
"Associations will be classified by multiplicity and whether or not they map "
47
 
"to an intervening join table."
48
 
msgstr ""
49
 
"Nous utiliserons deux critères pour classer les associations : le premier "
50
 
"sera de savoir si l'association est bâti sur une table supplémentaire "
51
 
"d'association et le deuxieme sera basé sur la multiplicité de cette "
52
 
"association."
53
 
 
54
 
#. Tag: para
55
 
#: association_mapping.xml:48
56
 
#, fuzzy, no-c-format
57
 
msgid ""
58
 
"Nullable foreign keys are not considered to be good practice in traditional "
59
 
"data modelling, so our examples do not use nullable foreign keys. This is "
60
 
"not a requirement of Hibernate, and the mappings will work if you drop the "
61
 
"nullability constraints."
62
 
msgstr ""
63
 
"Autoriser une clé étrangère nulle est considéré comme un mauvais choix dans "
64
 
"la construction d'un modèle de données. Nous supposerons donc que dans tous "
65
 
"les exemples qui vont suivre on aura interdit la valeur nulle pour les clés "
66
 
"étrangères. Attention, ceci ne veut pas dire que Hibernate ne supporte pas "
67
 
"les clés étrangères pouvant prendre des valeurs nulles, les exemples qui "
68
 
"suivent continueront de fonctionner si vous décidiez ne plus imposer la "
69
 
"contrainte de non-nullité sur les clés étrangères."
70
 
 
71
 
#. Tag: title
72
 
#: association_mapping.xml:58
73
 
#, no-c-format
74
 
msgid "Unidirectional associations"
75
 
msgstr "Association unidirectionnelle"
76
 
 
77
 
#. Tag: title
78
 
#: association_mapping.xml:61 association_mapping.xml:132
79
 
#, fuzzy, no-c-format
80
 
msgid "Many-to-one"
81
 
msgstr "plusieurs à un"
82
 
 
83
 
#. Tag: para
84
 
#: association_mapping.xml:63
85
 
#, no-c-format
86
 
msgid ""
87
 
"A <emphasis>unidirectional many-to-one association</emphasis> is the most "
88
 
"common kind of unidirectional association."
89
 
msgstr ""
90
 
"Une <emphasis>association plusieurs-à-un (many-to-one) unidirectionnelle </"
91
 
"emphasis> est le type que l'on rencontre le plus souvent dans les "
92
 
"associations unidirectionnelles."
93
 
 
94
 
#. Tag: programlisting
95
 
#: association_mapping.xml:68
96
 
#, no-c-format
97
 
msgid ""
98
 
"<![CDATA[<class name=\"Person\">\n"
99
 
"    <id name=\"id\" column=\"personId\">\n"
100
 
"        <generator class=\"native\"/>\n"
101
 
"    </id>\n"
102
 
"    <many-to-one name=\"address\" \n"
103
 
"        column=\"addressId\"\n"
104
 
"        not-null=\"true\"/>\n"
105
 
"</class>\n"
106
 
"\n"
107
 
"<class name=\"Address\">\n"
108
 
"    <id name=\"id\" column=\"addressId\">\n"
109
 
"        <generator class=\"native\"/>\n"
110
 
"    </id>\n"
111
 
"</class>]]>"
112
 
msgstr ""
113
 
 
114
 
#. Tag: programlisting
115
 
#: association_mapping.xml:69 association_mapping.xml:185
116
 
#, no-c-format
117
 
msgid ""
118
 
"<![CDATA[\n"
119
 
"create table Person ( personId bigint not null primary key, addressId bigint "
120
 
"not null )\n"
121
 
"create table Address ( addressId bigint not null primary key )\n"
122
 
"        ]]>"
123
 
msgstr ""
124
 
 
125
 
#. Tag: title
126
 
#: association_mapping.xml:74 association_mapping.xml:145
127
 
#: association_mapping.xml:210
128
 
#, fuzzy, no-c-format
129
 
msgid "One-to-one"
130
 
msgstr ""
131
 
"#-#-#-#-#  - (PACKAGE VERSION)  #-#-#-#-#\n"
132
 
"un à un\n"
133
 
"#-#-#-#-#  - (PACKAGE VERSION)  #-#-#-#-#\n"
134
 
"un à un\n"
135
 
"#-#-#-#-#  - (PACKAGE VERSION)  #-#-#-#-#\n"
136
 
"Un à un\n"
137
 
"#-#-#-#-#  - (PACKAGE VERSION)  #-#-#-#-#\n"
138
 
"Un à un"
139
 
 
140
 
#. Tag: para
141
 
#: association_mapping.xml:76
142
 
#, no-c-format
143
 
msgid ""
144
 
"A <emphasis>unidirectional one-to-one association on a foreign key</"
145
 
"emphasis> is almost identical. The only difference is the column unique "
146
 
"constraint."
147
 
msgstr ""
148
 
"une <emphasis>association un-à-un (one-to-one) sur une clé étrangère</"
149
 
"emphasis> est presque identique. La seule différence est sur la contrainte "
150
 
"d'unicité que l'on impose à cette colonne."
151
 
 
152
 
#. Tag: programlisting
153
 
#: association_mapping.xml:81
154
 
#, no-c-format
155
 
msgid ""
156
 
"<![CDATA[<class name=\"Person\">\n"
157
 
"    <id name=\"id\" column=\"personId\">\n"
158
 
"        <generator class=\"native\"/>\n"
159
 
"    </id>\n"
160
 
"    <many-to-one name=\"address\" \n"
161
 
"        column=\"addressId\" \n"
162
 
"        unique=\"true\"\n"
163
 
"        not-null=\"true\"/>\n"
164
 
"</class>\n"
165
 
"\n"
166
 
"<class name=\"Address\">\n"
167
 
"    <id name=\"id\" column=\"addressId\">\n"
168
 
"        <generator class=\"native\"/>\n"
169
 
"    </id>\n"
170
 
"</class>]]>"
171
 
msgstr ""
172
 
 
173
 
#. Tag: programlisting
174
 
#: association_mapping.xml:82 association_mapping.xml:218
175
 
#, no-c-format
176
 
msgid ""
177
 
"<![CDATA[\n"
178
 
"create table Person ( personId bigint not null primary key, addressId bigint "
179
 
"not null unique )\n"
180
 
"create table Address ( addressId bigint not null primary key )\n"
181
 
"        ]]>"
182
 
msgstr ""
183
 
 
184
 
#. Tag: para
185
 
#: association_mapping.xml:84
186
 
#, fuzzy, no-c-format
187
 
msgid ""
188
 
"A <emphasis>unidirectional one-to-one association on a primary key</"
189
 
"emphasis> usually uses a special id generator In this example, however, we "
190
 
"have reversed the direction of the association:"
191
 
msgstr ""
192
 
"Une <emphasis>association un-à-un (one-to-one) unidirectionnelle sur une clé "
193
 
"primaire</emphasis> utilise un générateur d'identifiant particulier. "
194
 
"(Remarquez que nous avons inversé le sens de cette association dans cet "
195
 
"exemple.)"
196
 
 
197
 
#. Tag: programlisting
198
 
#: association_mapping.xml:90
199
 
#, no-c-format
200
 
msgid ""
201
 
"<![CDATA[<class name=\"Person\">\n"
202
 
"    <id name=\"id\" column=\"personId\">\n"
203
 
"        <generator class=\"native\"/>\n"
204
 
"    </id>\n"
205
 
"</class>\n"
206
 
"\n"
207
 
"<class name=\"Address\">\n"
208
 
"    <id name=\"id\" column=\"personId\">\n"
209
 
"        <generator class=\"foreign\">\n"
210
 
"            <param name=\"property\">person</param>\n"
211
 
"        </generator>\n"
212
 
"    </id>\n"
213
 
"    <one-to-one name=\"person\" constrained=\"true\"/>\n"
214
 
"</class>]]>"
215
 
msgstr ""
216
 
 
217
 
#. Tag: programlisting
218
 
#: association_mapping.xml:91 association_mapping.xml:226
219
 
#, no-c-format
220
 
msgid ""
221
 
"<![CDATA[\n"
222
 
"create table Person ( personId bigint not null primary key )\n"
223
 
"create table Address ( personId bigint not null primary key )\n"
224
 
"        ]]>"
225
 
msgstr ""
226
 
 
227
 
#. Tag: title
228
 
#: association_mapping.xml:96 association_mapping.xml:118
229
 
#, fuzzy, no-c-format
230
 
msgid "One-to-many"
231
 
msgstr "un à plusieurs"
232
 
 
233
 
#. Tag: para
234
 
#: association_mapping.xml:98
235
 
#, fuzzy, no-c-format
236
 
msgid ""
237
 
"A <emphasis>unidirectional one-to-many association on a foreign key</"
238
 
"emphasis> is an unusual case, and is not recommended."
239
 
msgstr ""
240
 
"Une <emphasis>association un-à-plusieurs (one-to-many) unidirectionnelle sur "
241
 
"une clé étrangère</emphasis> est vraiment inhabituelle, et n'est pas "
242
 
"vraiment recommandée."
243
 
 
244
 
#. Tag: programlisting
245
 
#: association_mapping.xml:103
246
 
#, no-c-format
247
 
msgid ""
248
 
"<![CDATA[<class name=\"Person\">\n"
249
 
"    <id name=\"id\" column=\"personId\">\n"
250
 
"        <generator class=\"native\"/>\n"
251
 
"    </id>\n"
252
 
"    <set name=\"addresses\">\n"
253
 
"        <key column=\"personId\" \n"
254
 
"            not-null=\"true\"/>\n"
255
 
"        <one-to-many class=\"Address\"/>\n"
256
 
"    </set>\n"
257
 
"</class>\n"
258
 
"\n"
259
 
"<class name=\"Address\">\n"
260
 
"    <id name=\"id\" column=\"addressId\">\n"
261
 
"        <generator class=\"native\"/>\n"
262
 
"    </id>\n"
263
 
"</class>]]>"
264
 
msgstr ""
265
 
 
266
 
#. Tag: programlisting
267
 
#: association_mapping.xml:104
268
 
#, no-c-format
269
 
msgid ""
270
 
"<![CDATA[\n"
271
 
"create table Person ( personId bigint not null primary key )\n"
272
 
"create table Address ( addressId bigint not null primary key, personId "
273
 
"bigint not null )\n"
274
 
"        ]]>"
275
 
msgstr ""
276
 
 
277
 
#. Tag: para
278
 
#: association_mapping.xml:106
279
 
#, fuzzy, no-c-format
280
 
msgid "You should instead use a join table for this kind of association."
281
 
msgstr ""
282
 
"Nous pensons qu'il est préférable d'utiliser une table de jointure pour ce "
283
 
"type d'association."
284
 
 
285
 
#. Tag: title
286
 
#: association_mapping.xml:115
287
 
#, no-c-format
288
 
msgid "Unidirectional associations with join tables"
289
 
msgstr "Associations unidirectionnelles avec tables de jointure"
290
 
 
291
 
#. Tag: para
292
 
#: association_mapping.xml:120
293
 
#, fuzzy, no-c-format
294
 
msgid ""
295
 
"A <emphasis>unidirectional one-to-many association on a join table</"
296
 
"emphasis> is the preferred option. Specifying <literal>unique=\"true\"</"
297
 
"literal>, changes the multiplicity from many-to-many to one-to-many."
298
 
msgstr ""
299
 
"Une <emphasis>association unidirectionnelle un-à-plusieurs (one-to-many) "
300
 
"avec une table de jointure</emphasis> est un bien meilleur choix. Remarquez "
301
 
"qu'en spécifiant <literal>unique=\"true\"</literal>, on a changé la "
302
 
"multiplicité plusieurs-à-plusieurs (many-to-many) pour un-à-plusieurs (one-"
303
 
"to-many)."
304
 
 
305
 
#. Tag: programlisting
306
 
#: association_mapping.xml:126
307
 
#, no-c-format
308
 
msgid ""
309
 
"<![CDATA[<class name=\"Person\">\n"
310
 
"    <id name=\"id\" column=\"personId\">\n"
311
 
"        <generator class=\"native\"/>\n"
312
 
"    </id>\n"
313
 
"    <set name=\"addresses\" table=\"PersonAddress\">\n"
314
 
"        <key column=\"personId\"/>\n"
315
 
"        <many-to-many column=\"addressId\"\n"
316
 
"            unique=\"true\"\n"
317
 
"            class=\"Address\"/>\n"
318
 
"    </set>\n"
319
 
"</class>\n"
320
 
"\n"
321
 
"<class name=\"Address\">\n"
322
 
"    <id name=\"id\" column=\"addressId\">\n"
323
 
"        <generator class=\"native\"/>\n"
324
 
"    </id>\n"
325
 
"</class>]]>"
326
 
msgstr ""
327
 
 
328
 
#. Tag: programlisting
329
 
#: association_mapping.xml:127
330
 
#, no-c-format
331
 
msgid ""
332
 
"<![CDATA[\n"
333
 
"create table Person ( personId bigint not null primary key )\n"
334
 
"create table PersonAddress ( personId not null, addressId bigint not null "
335
 
"primary key )\n"
336
 
"create table Address ( addressId bigint not null primary key )\n"
337
 
"        ]]>"
338
 
msgstr ""
339
 
 
340
 
#. Tag: para
341
 
#: association_mapping.xml:134
342
 
#, fuzzy, no-c-format
343
 
msgid ""
344
 
"A <emphasis>unidirectional many-to-one association on a join table</"
345
 
"emphasis> is common when the association is optional. For example:"
346
 
msgstr ""
347
 
"Une <emphasis>assiociation plusieurs-à-un (many-to-one) unidirectionnelle "
348
 
"sur une table de jointure</emphasis> est très fréquente quand l'association "
349
 
"est optionnelle."
350
 
 
351
 
#. Tag: programlisting
352
 
#: association_mapping.xml:139
353
 
#, no-c-format
354
 
msgid ""
355
 
"<![CDATA[<class name=\"Person\">\n"
356
 
"    <id name=\"id\" column=\"personId\">\n"
357
 
"        <generator class=\"native\"/>\n"
358
 
"    </id>\n"
359
 
"    <join table=\"PersonAddress\" \n"
360
 
"        optional=\"true\">\n"
361
 
"        <key column=\"personId\" unique=\"true\"/>\n"
362
 
"        <many-to-one name=\"address\"\n"
363
 
"            column=\"addressId\" \n"
364
 
"            not-null=\"true\"/>\n"
365
 
"    </join>\n"
366
 
"</class>\n"
367
 
"\n"
368
 
"<class name=\"Address\">\n"
369
 
"    <id name=\"id\" column=\"addressId\">\n"
370
 
"        <generator class=\"native\"/>\n"
371
 
"    </id>\n"
372
 
"</class>]]>"
373
 
msgstr ""
374
 
 
375
 
#. Tag: programlisting
376
 
#: association_mapping.xml:140
377
 
#, no-c-format
378
 
msgid ""
379
 
"<![CDATA[\n"
380
 
"create table Person ( personId bigint not null primary key )\n"
381
 
"create table PersonAddress ( personId bigint not null primary key, addressId "
382
 
"bigint not null )\n"
383
 
"create table Address ( addressId bigint not null primary key )\n"
384
 
"        ]]>"
385
 
msgstr ""
386
 
 
387
 
#. Tag: para
388
 
#: association_mapping.xml:147
389
 
#, fuzzy, no-c-format
390
 
msgid ""
391
 
"A <emphasis>unidirectional one-to-one association on a join table</emphasis> "
392
 
"is possible, but extremely unusual."
393
 
msgstr ""
394
 
"Une <emphasis>association unidirectionnelle un-à-un (one-to-one) sur une "
395
 
"table de jointure</emphasis> est extrèmement rare mais envisageable."
396
 
 
397
 
#. Tag: programlisting
398
 
#: association_mapping.xml:152
399
 
#, no-c-format
400
 
msgid ""
401
 
"<![CDATA[<class name=\"Person\">\n"
402
 
"    <id name=\"id\" column=\"personId\">\n"
403
 
"        <generator class=\"native\"/>\n"
404
 
"    </id>\n"
405
 
"    <join table=\"PersonAddress\" \n"
406
 
"        optional=\"true\">\n"
407
 
"        <key column=\"personId\" \n"
408
 
"            unique=\"true\"/>\n"
409
 
"        <many-to-one name=\"address\"\n"
410
 
"            column=\"addressId\" \n"
411
 
"            not-null=\"true\"\n"
412
 
"            unique=\"true\"/>\n"
413
 
"    </join>\n"
414
 
"</class>\n"
415
 
"\n"
416
 
"<class name=\"Address\">\n"
417
 
"    <id name=\"id\" column=\"addressId\">\n"
418
 
"        <generator class=\"native\"/>\n"
419
 
"    </id>\n"
420
 
"</class>]]>"
421
 
msgstr ""
422
 
 
423
 
#. Tag: programlisting
424
 
#: association_mapping.xml:153 association_mapping.xml:258
425
 
#, no-c-format
426
 
msgid ""
427
 
"<![CDATA[\n"
428
 
"create table Person ( personId bigint not null primary key )\n"
429
 
"create table PersonAddress ( personId bigint not null primary key, addressId "
430
 
"bigint not null unique )\n"
431
 
"create table Address ( addressId bigint not null primary key )\n"
432
 
"        ]]>"
433
 
msgstr ""
434
 
 
435
 
#. Tag: title
436
 
#: association_mapping.xml:158 association_mapping.xml:263
437
 
#, fuzzy, no-c-format
438
 
msgid "Many-to-many"
439
 
msgstr "plusieurs à plusieurs"
440
 
 
441
 
#. Tag: para
442
 
#: association_mapping.xml:160
443
 
#, fuzzy, no-c-format
444
 
msgid ""
445
 
"Finally, here is an example of a <emphasis>unidirectional many-to-many "
446
 
"association</emphasis>."
447
 
msgstr ""
448
 
"Finallement, nous avons <emphasis>l'association unidirectionnelle plusieurs-"
449
 
"à-plusieurs (many-to-many)</emphasis>."
450
 
 
451
 
#. Tag: programlisting
452
 
#: association_mapping.xml:164
453
 
#, no-c-format
454
 
msgid ""
455
 
"<![CDATA[<class name=\"Person\">\n"
456
 
"    <id name=\"id\" column=\"personId\">\n"
457
 
"        <generator class=\"native\"/>\n"
458
 
"    </id>\n"
459
 
"    <set name=\"addresses\" table=\"PersonAddress\">\n"
460
 
"        <key column=\"personId\"/>\n"
461
 
"        <many-to-many column=\"addressId\"\n"
462
 
"            class=\"Address\"/>\n"
463
 
"    </set>\n"
464
 
"</class>\n"
465
 
"\n"
466
 
"<class name=\"Address\">\n"
467
 
"    <id name=\"id\" column=\"addressId\">\n"
468
 
"        <generator class=\"native\"/>\n"
469
 
"    </id>\n"
470
 
"</class>]]>"
471
 
msgstr ""
472
 
 
473
 
#. Tag: programlisting
474
 
#: association_mapping.xml:165 association_mapping.xml:271
475
 
#, no-c-format
476
 
msgid ""
477
 
"<![CDATA[\n"
478
 
"create table Person ( personId bigint not null primary key )\n"
479
 
"create table PersonAddress ( personId bigint not null, addressId bigint not "
480
 
"null, primary key (personId, addressId) )\n"
481
 
"create table Address ( addressId bigint not null primary key )\n"
482
 
"        ]]>"
483
 
msgstr ""
484
 
 
485
 
#. Tag: title
486
 
#: association_mapping.xml:172
487
 
#, no-c-format
488
 
msgid "Bidirectional associations"
489
 
msgstr "Associations bidirectionnelles"
490
 
 
491
 
#. Tag: title
492
 
#: association_mapping.xml:175 association_mapping.xml:236
493
 
#, fuzzy, no-c-format
494
 
msgid "one-to-many / many-to-one"
495
 
msgstr "un à plusieurs / plusieurs à un"
496
 
 
497
 
#. Tag: para
498
 
#: association_mapping.xml:177
499
 
#, fuzzy, no-c-format
500
 
msgid ""
501
 
"A <emphasis>bidirectional many-to-one association</emphasis> is the most "
502
 
"common kind of association. The following example illustrates the standard "
503
 
"parent/child relationship."
504
 
msgstr ""
505
 
"Une <emphasis>association bidirectionnelle plusieurs à un (many-to-one)</"
506
 
"emphasis> est le type d'association que l'on rencontre le plus souvent. "
507
 
"(c'est la façon standard de créer des relations parents/enfants.)"
508
 
 
509
 
#. Tag: programlisting
510
 
#: association_mapping.xml:183
511
 
#, no-c-format
512
 
msgid ""
513
 
"<![CDATA[<class name=\"Person\">\n"
514
 
"    <id name=\"id\" column=\"personId\">\n"
515
 
"        <generator class=\"native\"/>\n"
516
 
"    </id>\n"
517
 
"    <many-to-one name=\"address\" \n"
518
 
"        column=\"addressId\"\n"
519
 
"        not-null=\"true\"/>\n"
520
 
"</class>\n"
521
 
"\n"
522
 
"<class name=\"Address\">\n"
523
 
"    <id name=\"id\" column=\"addressId\">\n"
524
 
"        <generator class=\"native\"/>\n"
525
 
"    </id>\n"
526
 
"    <set name=\"people\" inverse=\"true\">\n"
527
 
"        <key column=\"addressId\"/>\n"
528
 
"        <one-to-many class=\"Person\"/>\n"
529
 
"    </set>\n"
530
 
"</class>]]>"
531
 
msgstr ""
532
 
 
533
 
#. Tag: para
534
 
#: association_mapping.xml:187
535
 
#, fuzzy, no-c-format
536
 
msgid ""
537
 
"If you use a <literal>List</literal>, or other indexed collection, set the "
538
 
"<literal>key</literal> column of the foreign key to <literal>not null</"
539
 
"literal>. Hibernate will manage the association from the collections side to "
540
 
"maintain the index of each element, making the other side virtually inverse "
541
 
"by setting <literal>update=\"false\"</literal> and <literal>insert=\"false"
542
 
"\"</literal>:"
543
 
msgstr ""
544
 
"Si vous utilisez une <literal>List</literal> (ou toute autre collection "
545
 
"indexée) vous devez paramétrer la colonne <literal>key</literal> de la clé "
546
 
"étrangère à <literal>not null</literal>, et laisser Hibernate gérer "
547
 
"l'association depuis l'extrémité collection pour maintenir l'index de chaque "
548
 
"élément (rendant l'autre extrémité virtuellement inverse en paramétrant "
549
 
"<literal>update=\"false\"</literal> et <literal>insert=\"false\"</literal>):"
550
 
 
551
 
#. Tag: programlisting
552
 
#: association_mapping.xml:195
553
 
#, no-c-format
554
 
msgid ""
555
 
"<![CDATA[<class name=\"Person\">\n"
556
 
"   <id name=\"id\"/>\n"
557
 
"   ...\n"
558
 
"   <many-to-one name=\"address\"\n"
559
 
"      column=\"addressId\"\n"
560
 
"      not-null=\"true\"\n"
561
 
"      insert=\"false\"\n"
562
 
"      update=\"false\"/>\n"
563
 
"</class>\n"
564
 
"\n"
565
 
"<class name=\"Address\">\n"
566
 
"   <id name=\"id\"/>\n"
567
 
"   ...\n"
568
 
"   <list name=\"people\">\n"
569
 
"      <key column=\"addressId\" not-null=\"true\"/>\n"
570
 
"      <list-index column=\"peopleIdx\"/>\n"
571
 
"      <one-to-many class=\"Person\"/>\n"
572
 
"   </list>\n"
573
 
"</class>]]>"
574
 
msgstr ""
575
 
 
576
 
#. Tag: para
577
 
#: association_mapping.xml:197
578
 
#, fuzzy, no-c-format
579
 
msgid ""
580
 
"If the underlying foreign key column is <literal>NOT NULL</literal>, it is "
581
 
"important that you define <literal>not-null=\"true\"</literal> on the "
582
 
"<literal>&lt;key&gt;</literal> element of the collection mapping. Do not "
583
 
"only declare <literal>not-null=\"true\"</literal> on a possible nested "
584
 
"<literal>&lt;column&gt;</literal> element, but on the <literal>&lt;key&gt;</"
585
 
"literal> element."
586
 
msgstr ""
587
 
"It is important that you define <literal>not-null=\"true\"</literal> on the "
588
 
"<literal>&lt;key&gt;</literal> element of the collection mapping if the "
589
 
"underlying foreign key column is <literal>NOT NULL</literal>. Don't only "
590
 
"declare <literal>not-null=\"true\"</literal> on a possible nested "
591
 
"<literal>&lt;column&gt;</literal> element, but on the <literal>&lt;key&gt;</"
592
 
"literal> element."
593
 
 
594
 
#. Tag: para
595
 
#: association_mapping.xml:212
596
 
#, fuzzy, no-c-format
597
 
msgid ""
598
 
"A <emphasis>bidirectional one-to-one association on a foreign key</emphasis> "
599
 
"is common:"
600
 
msgstr ""
601
 
"Une <emphasis>association bidirectionnelle un à un (one-to-one) sur une clé "
602
 
"étrangère</emphasis> est aussi très fréquente."
603
 
 
604
 
#. Tag: programlisting
605
 
#: association_mapping.xml:217
606
 
#, no-c-format
607
 
msgid ""
608
 
"<![CDATA[<class name=\"Person\">\n"
609
 
"    <id name=\"id\" column=\"personId\">\n"
610
 
"        <generator class=\"native\"/>\n"
611
 
"    </id>\n"
612
 
"    <many-to-one name=\"address\" \n"
613
 
"        column=\"addressId\" \n"
614
 
"        unique=\"true\"\n"
615
 
"        not-null=\"true\"/>\n"
616
 
"</class>\n"
617
 
"\n"
618
 
"<class name=\"Address\">\n"
619
 
"    <id name=\"id\" column=\"addressId\">\n"
620
 
"        <generator class=\"native\"/>\n"
621
 
"    </id>\n"
622
 
"   <one-to-one name=\"person\" \n"
623
 
"        property-ref=\"address\"/>\n"
624
 
"</class>]]>"
625
 
msgstr ""
626
 
 
627
 
#. Tag: para
628
 
#: association_mapping.xml:220
629
 
#, fuzzy, no-c-format
630
 
msgid ""
631
 
"A <emphasis>bidirectional one-to-one association on a primary key</emphasis> "
632
 
"uses the special id generator:"
633
 
msgstr ""
634
 
"Une <emphasis>association bidirectionnelle un-à-un (one-to-one) sur une clé "
635
 
"primaire</emphasis> utilise un générateur particulier d'id."
636
 
 
637
 
#. Tag: programlisting
638
 
#: association_mapping.xml:225
639
 
#, no-c-format
640
 
msgid ""
641
 
"<![CDATA[<class name=\"Person\">\n"
642
 
"    <id name=\"id\" column=\"personId\">\n"
643
 
"        <generator class=\"native\"/>\n"
644
 
"    </id>\n"
645
 
"    <one-to-one name=\"address\"/>\n"
646
 
"</class>\n"
647
 
"\n"
648
 
"<class name=\"Address\">\n"
649
 
"    <id name=\"id\" column=\"personId\">\n"
650
 
"        <generator class=\"foreign\">\n"
651
 
"            <param name=\"property\">person</param>\n"
652
 
"        </generator>\n"
653
 
"    </id>\n"
654
 
"    <one-to-one name=\"person\" \n"
655
 
"        constrained=\"true\"/>\n"
656
 
"</class>]]>"
657
 
msgstr ""
658
 
 
659
 
#. Tag: title
660
 
#: association_mapping.xml:233
661
 
#, no-c-format
662
 
msgid "Bidirectional associations with join tables"
663
 
msgstr "Associations bidirectionnelles avec table de jointure"
664
 
 
665
 
#. Tag: para
666
 
#: association_mapping.xml:238
667
 
#, fuzzy, no-c-format
668
 
msgid ""
669
 
"The following is an example of a <emphasis>bidirectional one-to-many "
670
 
"association on a join table</emphasis>. The <literal>inverse=\"true\"</"
671
 
"literal> can go on either end of the association, on the collection, or on "
672
 
"the join."
673
 
msgstr ""
674
 
"Une <emphasis>association bidirectionnelle un-à-plusieurs (one-to-many) sur "
675
 
"une table de jointure </emphasis>. Remarquez que <literal>inverse=\"true\"</"
676
 
"literal> peut s'appliquer sur les deux extrémités de l' association, sur la "
677
 
"collection, ou sur la jointure."
678
 
 
679
 
#. Tag: programlisting
680
 
#: association_mapping.xml:244
681
 
#, no-c-format
682
 
msgid ""
683
 
"<![CDATA[<class name=\"Person\">\n"
684
 
"    <id name=\"id\" column=\"personId\">\n"
685
 
"        <generator class=\"native\"/>\n"
686
 
"    </id>\n"
687
 
"    <set name=\"addresses\" \n"
688
 
"        table=\"PersonAddress\">\n"
689
 
"        <key column=\"personId\"/>\n"
690
 
"        <many-to-many column=\"addressId\"\n"
691
 
"            unique=\"true\"\n"
692
 
"            class=\"Address\"/>\n"
693
 
"    </set>\n"
694
 
"</class>\n"
695
 
"\n"
696
 
"<class name=\"Address\">\n"
697
 
"    <id name=\"id\" column=\"addressId\">\n"
698
 
"        <generator class=\"native\"/>\n"
699
 
"    </id>\n"
700
 
"    <join table=\"PersonAddress\" \n"
701
 
"        inverse=\"true\" \n"
702
 
"        optional=\"true\">\n"
703
 
"        <key column=\"addressId\"/>\n"
704
 
"        <many-to-one name=\"person\"\n"
705
 
"            column=\"personId\"\n"
706
 
"            not-null=\"true\"/>\n"
707
 
"    </join>\n"
708
 
"</class>]]>"
709
 
msgstr ""
710
 
 
711
 
#. Tag: programlisting
712
 
#: association_mapping.xml:245
713
 
#, no-c-format
714
 
msgid ""
715
 
"<![CDATA[\n"
716
 
"create table Person ( personId bigint not null primary key )\n"
717
 
"create table PersonAddress ( personId bigint not null, addressId bigint not "
718
 
"null primary key )\n"
719
 
"create table Address ( addressId bigint not null primary key )\n"
720
 
"        ]]>"
721
 
msgstr ""
722
 
 
723
 
#. Tag: title
724
 
#: association_mapping.xml:250
725
 
#, fuzzy, no-c-format
726
 
msgid "one to one"
727
 
msgstr ""
728
 
"#-#-#-#-#  - (PACKAGE VERSION)  #-#-#-#-#\n"
729
 
"un à un\n"
730
 
"#-#-#-#-#  - (PACKAGE VERSION)  #-#-#-#-#\n"
731
 
"un à un\n"
732
 
"#-#-#-#-#  - (PACKAGE VERSION)  #-#-#-#-#\n"
733
 
"Un à un\n"
734
 
"#-#-#-#-#  - (PACKAGE VERSION)  #-#-#-#-#\n"
735
 
"Un à un"
736
 
 
737
 
#. Tag: para
738
 
#: association_mapping.xml:252
739
 
#, fuzzy, no-c-format
740
 
msgid ""
741
 
"A <emphasis>bidirectional one-to-one association on a join table</emphasis> "
742
 
"is possible, but extremely unusual."
743
 
msgstr ""
744
 
"Une <emphasis>association bidirectionnelle un-à-un (one-to-one) sur une "
745
 
"table de jointure</emphasis> est extrèmement rare mais envisageable."
746
 
 
747
 
#. Tag: programlisting
748
 
#: association_mapping.xml:257
749
 
#, no-c-format
750
 
msgid ""
751
 
"<![CDATA[<class name=\"Person\">\n"
752
 
"    <id name=\"id\" column=\"personId\">\n"
753
 
"        <generator class=\"native\"/>\n"
754
 
"    </id>\n"
755
 
"    <join table=\"PersonAddress\" \n"
756
 
"        optional=\"true\">\n"
757
 
"        <key column=\"personId\" \n"
758
 
"            unique=\"true\"/>\n"
759
 
"        <many-to-one name=\"address\"\n"
760
 
"            column=\"addressId\" \n"
761
 
"            not-null=\"true\"\n"
762
 
"            unique=\"true\"/>\n"
763
 
"    </join>\n"
764
 
"</class>\n"
765
 
"\n"
766
 
"<class name=\"Address\">\n"
767
 
"    <id name=\"id\" column=\"addressId\">\n"
768
 
"        <generator class=\"native\"/>\n"
769
 
"    </id>\n"
770
 
"    <join table=\"PersonAddress\" \n"
771
 
"        optional=\"true\"\n"
772
 
"        inverse=\"true\">\n"
773
 
"        <key column=\"addressId\" \n"
774
 
"            unique=\"true\"/>\n"
775
 
"        <many-to-one name=\"person\"\n"
776
 
"            column=\"personId\" \n"
777
 
"            not-null=\"true\"\n"
778
 
"            unique=\"true\"/>\n"
779
 
"    </join>\n"
780
 
"</class>]]>"
781
 
msgstr ""
782
 
 
783
 
#. Tag: para
784
 
#: association_mapping.xml:265
785
 
#, fuzzy, no-c-format
786
 
msgid ""
787
 
"Here is an example of a <emphasis>bidirectional many-to-many association</"
788
 
"emphasis>."
789
 
msgstr ""
790
 
"Finallement nous avons <emphasis>l'association bidirectionnelle plusieurs à "
791
 
"plusieurs</emphasis>."
792
 
 
793
 
#. Tag: programlisting
794
 
#: association_mapping.xml:269
795
 
#, no-c-format
796
 
msgid ""
797
 
"<![CDATA[<class name=\"Person\">\n"
798
 
"    <id name=\"id\" column=\"personId\">\n"
799
 
"        <generator class=\"native\"/>\n"
800
 
"    </id>\n"
801
 
"    <set name=\"addresses\" table=\"PersonAddress\">\n"
802
 
"        <key column=\"personId\"/>\n"
803
 
"        <many-to-many column=\"addressId\"\n"
804
 
"            class=\"Address\"/>\n"
805
 
"    </set>\n"
806
 
"</class>\n"
807
 
"\n"
808
 
"<class name=\"Address\">\n"
809
 
"    <id name=\"id\" column=\"addressId\">\n"
810
 
"        <generator class=\"native\"/>\n"
811
 
"    </id>\n"
812
 
"    <set name=\"people\" inverse=\"true\" table=\"PersonAddress\">\n"
813
 
"        <key column=\"addressId\"/>\n"
814
 
"        <many-to-many column=\"personId\"\n"
815
 
"            class=\"Person\"/>\n"
816
 
"    </set>\n"
817
 
"</class>]]>"
818
 
msgstr ""
819
 
 
820
 
#. Tag: title
821
 
#: association_mapping.xml:278
822
 
#, no-c-format
823
 
msgid "More complex association mappings"
824
 
msgstr "Des mappings plus complexes"
825
 
 
826
 
#. Tag: para
827
 
#: association_mapping.xml:280
828
 
#, fuzzy, no-c-format
829
 
msgid ""
830
 
"More complex association joins are <emphasis>extremely</emphasis> rare. "
831
 
"Hibernate handles more complex situations by using SQL fragments embedded in "
832
 
"the mapping document. For example, if a table with historical account "
833
 
"information data defines <literal>accountNumber</literal>, "
834
 
"<literal>effectiveEndDate</literal> and <literal>effectiveStartDate</"
835
 
"literal>columns, it would be mapped as follows:"
836
 
msgstr ""
837
 
"Des associations encore plus complexes sont <emphasis>extrêmement</emphasis> "
838
 
"rares. Hibernate permet de gérer des situations plus complexes en utilisant "
839
 
"des parties SQL dans les fichiers de mapping. Par exemple, si une table avec "
840
 
"l'historiques des informations d'un compte définit les colonnes "
841
 
"<literal>accountNumber</literal>, <literal>effectiveEndDate</literal> et "
842
 
"<literal>effectiveStartDate</literal>, mappées de telle sorte:"
843
 
 
844
 
#. Tag: programlisting
845
 
#: association_mapping.xml:289
846
 
#, no-c-format
847
 
msgid ""
848
 
"<![CDATA[<properties name=\"currentAccountKey\">\n"
849
 
"    <property name=\"accountNumber\" type=\"string\" not-null=\"true\"/>\n"
850
 
"    <property name=\"currentAccount\" type=\"boolean\">\n"
851
 
"        <formula>case when effectiveEndDate is null then 1 else 0 end</"
852
 
"formula>\n"
853
 
"    </property>\n"
854
 
"</properties>\n"
855
 
"<property name=\"effectiveEndDate\" type=\"date\"/>\n"
856
 
"<property name=\"effectiveStateDate\" type=\"date\" not-null=\"true\"/>]]>"
857
 
msgstr ""
858
 
 
859
 
#. Tag: para
860
 
#: association_mapping.xml:291
861
 
#, fuzzy, no-c-format
862
 
msgid ""
863
 
"You can then map an association to the <emphasis>current</emphasis> "
864
 
"instance, the one with null <literal>effectiveEndDate</literal>, by using:"
865
 
msgstr ""
866
 
"alors nous pouvons mapper une association à l'instance <emphasis>courante</"
867
 
"emphasis> (celle avec une <literal>effectiveEndDate</literal>) nulle en "
868
 
"utilisant:"
869
 
 
870
 
#. Tag: programlisting
871
 
#: association_mapping.xml:296
872
 
#, no-c-format
873
 
msgid ""
874
 
"<![CDATA[<many-to-one name=\"currentAccountInfo\" \n"
875
 
"        property-ref=\"currentAccountKey\"\n"
876
 
"        class=\"AccountInfo\">\n"
877
 
"    <column name=\"accountNumber\"/>\n"
878
 
"    <formula>'1'</formula>\n"
879
 
"</many-to-one>]]>"
880
 
msgstr ""
881
 
 
882
 
#. Tag: para
883
 
#: association_mapping.xml:298
884
 
#, fuzzy, no-c-format
885
 
msgid ""
886
 
"In a more complex example, imagine that the association between "
887
 
"<literal>Employee</literal> and <literal>Organization</literal> is "
888
 
"maintained in an <literal>Employment</literal> table full of historical "
889
 
"employment data. An association to the employee's <emphasis>most recent</"
890
 
"emphasis> employer, the one with the most recent <literal>startDate</"
891
 
"literal>, could be mapped in the following way:"
892
 
msgstr ""
893
 
"Dans un exemple plus complexe, imaginez qu'une association entre "
894
 
"<literal>Employee</literal> et <literal>Organization</literal> est gérée "
895
 
"dans une table <literal>Employment</literal> pleines de données historiques. "
896
 
"Dans ce cas, une association vers l'employeur <emphasis>le plus récent</"
897
 
"emphasis> (celui avec la <literal>startDate</literal> la plus récente) "
898
 
"pourrait être mappée comme cela:"
899
 
 
900
 
#. Tag: programlisting
901
 
#: association_mapping.xml:306
902
 
#, no-c-format
903
 
msgid ""
904
 
"<![CDATA[<join>\n"
905
 
"    <key column=\"employeeId\"/>\n"
906
 
"    <subselect>\n"
907
 
"        select employeeId, orgId \n"
908
 
"        from Employments \n"
909
 
"        group by orgId \n"
910
 
"        having startDate = max(startDate)\n"
911
 
"    </subselect>\n"
912
 
"    <many-to-one name=\"mostRecentEmployer\" \n"
913
 
"            class=\"Organization\" \n"
914
 
"            column=\"orgId\"/>\n"
915
 
"</join>]]>"
916
 
msgstr ""
917
 
 
918
 
#. Tag: para
919
 
#: association_mapping.xml:308
920
 
#, fuzzy, no-c-format
921
 
msgid ""
922
 
"This functionality allows a degree of creativity and flexibility, but it is "
923
 
"more practical to handle these kinds of cases using HQL or a criteria query."
924
 
msgstr ""
925
 
"Vous pouvez être créatif grace à ces possibilités, mais il est généralement "
926
 
"plus pratique d'utiliser des requêtes HQL ou criteria dans ce genre de "
927
 
"situation."