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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
|
/*******************************************************************************
* Copyright (c) 2006 Oracle. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: Oracle. - initial API and implementation
*******************************************************************************/
package org.eclipse.jpt.core.internal.content.persistence;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EDataTypeEList;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jpt.core.internal.XmlEObject;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Persistence Unit</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getDescription <em>Description</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getProvider <em>Provider</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getJtaDataSource <em>Jta Data Source</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getNonJtaDataSource <em>Non Jta Data Source</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getMappingFiles <em>Mapping Files</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getJarFiles <em>Jar Files</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getClasses <em>Classes</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#isExcludeUnlistedClasses <em>Exclude Unlisted Classes</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getProperties <em>Properties</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getTransactionType <em>Transaction Type</em>}</li>
* </ul>
* </p>
*
* @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit()
* @model kind="class"
* @generated
*/
public class PersistenceUnit extends XmlEObject
{
/**
* The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected static final String DESCRIPTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected String description = DESCRIPTION_EDEFAULT;
/**
* The default value of the '{@link #getProvider() <em>Provider</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProvider()
* @generated
* @ordered
*/
protected static final String PROVIDER_EDEFAULT = null;
/**
* The cached value of the '{@link #getProvider() <em>Provider</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProvider()
* @generated
* @ordered
*/
protected String provider = PROVIDER_EDEFAULT;
/**
* The default value of the '{@link #getJtaDataSource() <em>Jta Data Source</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getJtaDataSource()
* @generated
* @ordered
*/
protected static final String JTA_DATA_SOURCE_EDEFAULT = null;
/**
* The cached value of the '{@link #getJtaDataSource() <em>Jta Data Source</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getJtaDataSource()
* @generated
* @ordered
*/
protected String jtaDataSource = JTA_DATA_SOURCE_EDEFAULT;
/**
* The default value of the '{@link #getNonJtaDataSource() <em>Non Jta Data Source</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getNonJtaDataSource()
* @generated
* @ordered
*/
protected static final String NON_JTA_DATA_SOURCE_EDEFAULT = null;
/**
* The cached value of the '{@link #getNonJtaDataSource() <em>Non Jta Data Source</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getNonJtaDataSource()
* @generated
* @ordered
*/
protected String nonJtaDataSource = NON_JTA_DATA_SOURCE_EDEFAULT;
/**
* The cached value of the '{@link #getMappingFiles() <em>Mapping Files</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMappingFiles()
* @generated
* @ordered
*/
protected EList<MappingFileRef> mappingFiles;
/**
* The cached value of the '{@link #getJarFiles() <em>Jar Files</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getJarFiles()
* @generated
* @ordered
*/
protected EList<String> jarFiles;
/**
* The cached value of the '{@link #getClasses() <em>Classes</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getClasses()
* @generated
* @ordered
*/
protected EList<JavaClassRef> classes;
/**
* The default value of the '{@link #isExcludeUnlistedClasses() <em>Exclude Unlisted Classes</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isExcludeUnlistedClasses()
* @generated
* @ordered
*/
protected static final boolean EXCLUDE_UNLISTED_CLASSES_EDEFAULT = false;
/**
* The cached value of the '{@link #isExcludeUnlistedClasses() <em>Exclude Unlisted Classes</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isExcludeUnlistedClasses()
* @generated
* @ordered
*/
protected boolean excludeUnlistedClasses = EXCLUDE_UNLISTED_CLASSES_EDEFAULT;
/**
* This is true if the Exclude Unlisted Classes attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean excludeUnlistedClassesESet;
/**
* The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProperties()
* @generated
* @ordered
*/
protected Properties properties;
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #getTransactionType() <em>Transaction Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTransactionType()
* @generated
* @ordered
*/
protected static final PersistenceUnitTransactionType TRANSACTION_TYPE_EDEFAULT = PersistenceUnitTransactionType.JTA;
/**
* The cached value of the '{@link #getTransactionType() <em>Transaction Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTransactionType()
* @generated
* @ordered
*/
protected PersistenceUnitTransactionType transactionType = TRANSACTION_TYPE_EDEFAULT;
/**
* This is true if the Transaction Type attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean transactionTypeESet;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PersistenceUnit() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return PersistencePackage.Literals.PERSISTENCE_UNIT;
}
/**
* Returns the value of the '<em><b>Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Description</em>' attribute.
* @see #setDescription(String)
* @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_Description()
* @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
* @generated
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getDescription <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Description</em>' attribute.
* @see #getDescription()
* @generated
*/
public void setDescription(String newDescription) {
String oldDescription = description;
description = newDescription;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__DESCRIPTION, oldDescription, description));
}
/**
* Returns the value of the '<em><b>Provider</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Provider</em>' attribute.
* @see #setProvider(String)
* @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_Provider()
* @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
* @generated
*/
public String getProvider() {
return provider;
}
/**
* Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getProvider <em>Provider</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Provider</em>' attribute.
* @see #getProvider()
* @generated
*/
public void setProvider(String newProvider) {
String oldProvider = provider;
provider = newProvider;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__PROVIDER, oldProvider, provider));
}
/**
* Returns the value of the '<em><b>Jta Data Source</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Jta Data Source</em>' attribute.
* @see #setJtaDataSource(String)
* @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_JtaDataSource()
* @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
* @generated
*/
public String getJtaDataSource() {
return jtaDataSource;
}
/**
* Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getJtaDataSource <em>Jta Data Source</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Jta Data Source</em>' attribute.
* @see #getJtaDataSource()
* @generated
*/
public void setJtaDataSource(String newJtaDataSource) {
String oldJtaDataSource = jtaDataSource;
jtaDataSource = newJtaDataSource;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__JTA_DATA_SOURCE, oldJtaDataSource, jtaDataSource));
}
/**
* Returns the value of the '<em><b>Non Jta Data Source</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Non Jta Data Source</em>' attribute.
* @see #setNonJtaDataSource(String)
* @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_NonJtaDataSource()
* @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
* @generated
*/
public String getNonJtaDataSource() {
return nonJtaDataSource;
}
/**
* Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getNonJtaDataSource <em>Non Jta Data Source</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Non Jta Data Source</em>' attribute.
* @see #getNonJtaDataSource()
* @generated
*/
public void setNonJtaDataSource(String newNonJtaDataSource) {
String oldNonJtaDataSource = nonJtaDataSource;
nonJtaDataSource = newNonJtaDataSource;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE, oldNonJtaDataSource, nonJtaDataSource));
}
/**
* Returns the value of the '<em><b>Mapping Files</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.jpt.core.internal.content.persistence.MappingFileRef}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Mapping Files</em>' containment reference list.
* @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_MappingFiles()
* @model type="org.eclipse.jpt.core.internal.content.persistence.MappingFileRef" containment="true"
* @generated
*/
public EList<MappingFileRef> getMappingFiles() {
if (mappingFiles == null) {
mappingFiles = new EObjectContainmentEList<MappingFileRef>(MappingFileRef.class, this, PersistencePackage.PERSISTENCE_UNIT__MAPPING_FILES);
}
return mappingFiles;
}
/**
* Returns the value of the '<em><b>Jar Files</b></em>' attribute list.
* The list contents are of type {@link java.lang.String}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Jar Files</em>' attribute list.
* @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_JarFiles()
* @model type="java.lang.String" unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
* @generated
*/
public EList<String> getJarFiles() {
if (jarFiles == null) {
jarFiles = new EDataTypeEList<String>(String.class, this, PersistencePackage.PERSISTENCE_UNIT__JAR_FILES);
}
return jarFiles;
}
/**
* Returns the value of the '<em><b>Classes</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.jpt.core.internal.content.persistence.JavaClassRef}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Classes</em>' containment reference list.
* @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_Classes()
* @model type="org.eclipse.jpt.core.internal.content.persistence.JavaClassRef" containment="true"
* @generated
*/
public EList<JavaClassRef> getClasses() {
if (classes == null) {
classes = new EObjectContainmentEList<JavaClassRef>(JavaClassRef.class, this, PersistencePackage.PERSISTENCE_UNIT__CLASSES);
}
return classes;
}
/**
* Returns the value of the '<em><b>Exclude Unlisted Classes</b></em>' attribute.
* The default value is <code>"false"</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Exclude Unlisted Classes</em>' attribute.
* @see #isSetExcludeUnlistedClasses()
* @see #unsetExcludeUnlistedClasses()
* @see #setExcludeUnlistedClasses(boolean)
* @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_ExcludeUnlistedClasses()
* @model default="false" unique="false" unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Boolean"
* @generated
*/
public boolean isExcludeUnlistedClasses() {
return excludeUnlistedClasses;
}
/**
* Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#isExcludeUnlistedClasses <em>Exclude Unlisted Classes</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Exclude Unlisted Classes</em>' attribute.
* @see #isSetExcludeUnlistedClasses()
* @see #unsetExcludeUnlistedClasses()
* @see #isExcludeUnlistedClasses()
* @generated
*/
public void setExcludeUnlistedClasses(boolean newExcludeUnlistedClasses) {
boolean oldExcludeUnlistedClasses = excludeUnlistedClasses;
excludeUnlistedClasses = newExcludeUnlistedClasses;
boolean oldExcludeUnlistedClassesESet = excludeUnlistedClassesESet;
excludeUnlistedClassesESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES, oldExcludeUnlistedClasses, excludeUnlistedClasses, !oldExcludeUnlistedClassesESet));
}
/**
* Unsets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#isExcludeUnlistedClasses <em>Exclude Unlisted Classes</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSetExcludeUnlistedClasses()
* @see #isExcludeUnlistedClasses()
* @see #setExcludeUnlistedClasses(boolean)
* @generated
*/
public void unsetExcludeUnlistedClasses() {
boolean oldExcludeUnlistedClasses = excludeUnlistedClasses;
boolean oldExcludeUnlistedClassesESet = excludeUnlistedClassesESet;
excludeUnlistedClasses = EXCLUDE_UNLISTED_CLASSES_EDEFAULT;
excludeUnlistedClassesESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, PersistencePackage.PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES, oldExcludeUnlistedClasses, EXCLUDE_UNLISTED_CLASSES_EDEFAULT, oldExcludeUnlistedClassesESet));
}
/**
* Returns whether the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#isExcludeUnlistedClasses <em>Exclude Unlisted Classes</em>}' attribute is set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return whether the value of the '<em>Exclude Unlisted Classes</em>' attribute is set.
* @see #unsetExcludeUnlistedClasses()
* @see #isExcludeUnlistedClasses()
* @see #setExcludeUnlistedClasses(boolean)
* @generated
*/
public boolean isSetExcludeUnlistedClasses() {
return excludeUnlistedClassesESet;
}
/**
* Returns the value of the '<em><b>Properties</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Properties</em>' containment reference.
* @see #setProperties(Properties)
* @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_Properties()
* @model containment="true"
* @generated
*/
public Properties getProperties() {
return properties;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetProperties(Properties newProperties, NotificationChain msgs) {
Properties oldProperties = properties;
properties = newProperties;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__PROPERTIES, oldProperties, newProperties);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
* Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getProperties <em>Properties</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Properties</em>' containment reference.
* @see #getProperties()
* @generated
*/
public void setProperties(Properties newProperties) {
if (newProperties != properties) {
NotificationChain msgs = null;
if (properties != null)
msgs = ((InternalEObject) properties).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PersistencePackage.PERSISTENCE_UNIT__PROPERTIES, null, msgs);
if (newProperties != null)
msgs = ((InternalEObject) newProperties).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PersistencePackage.PERSISTENCE_UNIT__PROPERTIES, null, msgs);
msgs = basicSetProperties(newProperties, msgs);
if (msgs != null)
msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__PROPERTIES, newProperties, newProperties));
}
/**
* Returns the value of the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
* @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_Name()
* @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
* @generated
*/
public String getName() {
return name;
}
/**
* Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getName <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Name</em>' attribute.
* @see #getName()
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__NAME, oldName, name));
}
/**
* Returns the value of the '<em><b>Transaction Type</b></em>' attribute.
* The default value is <code>"JTA"</code>.
* The literals are from the enumeration {@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnitTransactionType}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Transaction Type</em>' attribute.
* @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnitTransactionType
* @see #isSetTransactionType()
* @see #unsetTransactionType()
* @see #setTransactionType(PersistenceUnitTransactionType)
* @see org.eclipse.jpt.core.internal.content.persistence.PersistencePackage#getPersistenceUnit_TransactionType()
* @model default="JTA" unique="false" unsettable="true"
* @generated
*/
public PersistenceUnitTransactionType getTransactionType() {
return transactionType;
}
/**
* Sets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getTransactionType <em>Transaction Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Transaction Type</em>' attribute.
* @see org.eclipse.jpt.core.internal.content.persistence.PersistenceUnitTransactionType
* @see #isSetTransactionType()
* @see #unsetTransactionType()
* @see #getTransactionType()
* @generated
*/
public void setTransactionType(PersistenceUnitTransactionType newTransactionType) {
PersistenceUnitTransactionType oldTransactionType = transactionType;
transactionType = newTransactionType == null ? TRANSACTION_TYPE_EDEFAULT : newTransactionType;
boolean oldTransactionTypeESet = transactionTypeESet;
transactionTypeESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.PERSISTENCE_UNIT__TRANSACTION_TYPE, oldTransactionType, transactionType, !oldTransactionTypeESet));
}
/**
* Unsets the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getTransactionType <em>Transaction Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSetTransactionType()
* @see #getTransactionType()
* @see #setTransactionType(PersistenceUnitTransactionType)
* @generated
*/
public void unsetTransactionType() {
PersistenceUnitTransactionType oldTransactionType = transactionType;
boolean oldTransactionTypeESet = transactionTypeESet;
transactionType = TRANSACTION_TYPE_EDEFAULT;
transactionTypeESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, PersistencePackage.PERSISTENCE_UNIT__TRANSACTION_TYPE, oldTransactionType, TRANSACTION_TYPE_EDEFAULT, oldTransactionTypeESet));
}
/**
* Returns whether the value of the '{@link org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit#getTransactionType <em>Transaction Type</em>}' attribute is set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return whether the value of the '<em>Transaction Type</em>' attribute is set.
* @see #unsetTransactionType()
* @see #getTransactionType()
* @see #setTransactionType(PersistenceUnitTransactionType)
* @generated
*/
public boolean isSetTransactionType() {
return transactionTypeESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case PersistencePackage.PERSISTENCE_UNIT__MAPPING_FILES :
return ((InternalEList<?>) getMappingFiles()).basicRemove(otherEnd, msgs);
case PersistencePackage.PERSISTENCE_UNIT__CLASSES :
return ((InternalEList<?>) getClasses()).basicRemove(otherEnd, msgs);
case PersistencePackage.PERSISTENCE_UNIT__PROPERTIES :
return basicSetProperties(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case PersistencePackage.PERSISTENCE_UNIT__DESCRIPTION :
return getDescription();
case PersistencePackage.PERSISTENCE_UNIT__PROVIDER :
return getProvider();
case PersistencePackage.PERSISTENCE_UNIT__JTA_DATA_SOURCE :
return getJtaDataSource();
case PersistencePackage.PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE :
return getNonJtaDataSource();
case PersistencePackage.PERSISTENCE_UNIT__MAPPING_FILES :
return getMappingFiles();
case PersistencePackage.PERSISTENCE_UNIT__JAR_FILES :
return getJarFiles();
case PersistencePackage.PERSISTENCE_UNIT__CLASSES :
return getClasses();
case PersistencePackage.PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES :
return isExcludeUnlistedClasses() ? Boolean.TRUE : Boolean.FALSE;
case PersistencePackage.PERSISTENCE_UNIT__PROPERTIES :
return getProperties();
case PersistencePackage.PERSISTENCE_UNIT__NAME :
return getName();
case PersistencePackage.PERSISTENCE_UNIT__TRANSACTION_TYPE :
return getTransactionType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case PersistencePackage.PERSISTENCE_UNIT__DESCRIPTION :
setDescription((String) newValue);
return;
case PersistencePackage.PERSISTENCE_UNIT__PROVIDER :
setProvider((String) newValue);
return;
case PersistencePackage.PERSISTENCE_UNIT__JTA_DATA_SOURCE :
setJtaDataSource((String) newValue);
return;
case PersistencePackage.PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE :
setNonJtaDataSource((String) newValue);
return;
case PersistencePackage.PERSISTENCE_UNIT__MAPPING_FILES :
getMappingFiles().clear();
getMappingFiles().addAll((Collection<? extends MappingFileRef>) newValue);
return;
case PersistencePackage.PERSISTENCE_UNIT__JAR_FILES :
getJarFiles().clear();
getJarFiles().addAll((Collection<? extends String>) newValue);
return;
case PersistencePackage.PERSISTENCE_UNIT__CLASSES :
getClasses().clear();
getClasses().addAll((Collection<? extends JavaClassRef>) newValue);
return;
case PersistencePackage.PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES :
setExcludeUnlistedClasses(((Boolean) newValue).booleanValue());
return;
case PersistencePackage.PERSISTENCE_UNIT__PROPERTIES :
setProperties((Properties) newValue);
return;
case PersistencePackage.PERSISTENCE_UNIT__NAME :
setName((String) newValue);
return;
case PersistencePackage.PERSISTENCE_UNIT__TRANSACTION_TYPE :
setTransactionType((PersistenceUnitTransactionType) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case PersistencePackage.PERSISTENCE_UNIT__DESCRIPTION :
setDescription(DESCRIPTION_EDEFAULT);
return;
case PersistencePackage.PERSISTENCE_UNIT__PROVIDER :
setProvider(PROVIDER_EDEFAULT);
return;
case PersistencePackage.PERSISTENCE_UNIT__JTA_DATA_SOURCE :
setJtaDataSource(JTA_DATA_SOURCE_EDEFAULT);
return;
case PersistencePackage.PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE :
setNonJtaDataSource(NON_JTA_DATA_SOURCE_EDEFAULT);
return;
case PersistencePackage.PERSISTENCE_UNIT__MAPPING_FILES :
getMappingFiles().clear();
return;
case PersistencePackage.PERSISTENCE_UNIT__JAR_FILES :
getJarFiles().clear();
return;
case PersistencePackage.PERSISTENCE_UNIT__CLASSES :
getClasses().clear();
return;
case PersistencePackage.PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES :
unsetExcludeUnlistedClasses();
return;
case PersistencePackage.PERSISTENCE_UNIT__PROPERTIES :
setProperties((Properties) null);
return;
case PersistencePackage.PERSISTENCE_UNIT__NAME :
setName(NAME_EDEFAULT);
return;
case PersistencePackage.PERSISTENCE_UNIT__TRANSACTION_TYPE :
unsetTransactionType();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case PersistencePackage.PERSISTENCE_UNIT__DESCRIPTION :
return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
case PersistencePackage.PERSISTENCE_UNIT__PROVIDER :
return PROVIDER_EDEFAULT == null ? provider != null : !PROVIDER_EDEFAULT.equals(provider);
case PersistencePackage.PERSISTENCE_UNIT__JTA_DATA_SOURCE :
return JTA_DATA_SOURCE_EDEFAULT == null ? jtaDataSource != null : !JTA_DATA_SOURCE_EDEFAULT.equals(jtaDataSource);
case PersistencePackage.PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE :
return NON_JTA_DATA_SOURCE_EDEFAULT == null ? nonJtaDataSource != null : !NON_JTA_DATA_SOURCE_EDEFAULT.equals(nonJtaDataSource);
case PersistencePackage.PERSISTENCE_UNIT__MAPPING_FILES :
return mappingFiles != null && !mappingFiles.isEmpty();
case PersistencePackage.PERSISTENCE_UNIT__JAR_FILES :
return jarFiles != null && !jarFiles.isEmpty();
case PersistencePackage.PERSISTENCE_UNIT__CLASSES :
return classes != null && !classes.isEmpty();
case PersistencePackage.PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES :
return isSetExcludeUnlistedClasses();
case PersistencePackage.PERSISTENCE_UNIT__PROPERTIES :
return properties != null;
case PersistencePackage.PERSISTENCE_UNIT__NAME :
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case PersistencePackage.PERSISTENCE_UNIT__TRANSACTION_TYPE :
return isSetTransactionType();
}
return super.eIsSet(featureID);
}
public Persistence getPersistence() {
return (Persistence) eContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (description: ");
result.append(description);
result.append(", provider: ");
result.append(provider);
result.append(", jtaDataSource: ");
result.append(jtaDataSource);
result.append(", nonJtaDataSource: ");
result.append(nonJtaDataSource);
result.append(", jarFiles: ");
result.append(jarFiles);
result.append(", excludeUnlistedClasses: ");
if (excludeUnlistedClassesESet)
result.append(excludeUnlistedClasses);
else
result.append("<unset>");
result.append(", name: ");
result.append(name);
result.append(", transactionType: ");
if (transactionTypeESet)
result.append(transactionType);
else
result.append("<unset>");
result.append(')');
return result.toString();
}
}
|