aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/oxm/schema/model/SimpleType.java')
-rw-r--r--foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/oxm/schema/model/SimpleType.java28
1 files changed, 16 insertions, 12 deletions
diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/oxm/schema/model/SimpleType.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/oxm/schema/model/SimpleType.java
index fa840dc..4200733 100644
--- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/oxm/schema/model/SimpleType.java
+++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/oxm/schema/model/SimpleType.java
@@ -33,18 +33,22 @@ public class SimpleType implements Restrictable {
public String getName() {
return name;
- }
-
- public void setRestriction(Restriction restriction) {
- this.restriction = restriction;
- if (restriction != null) {
- restriction.setOwner(this);
- }
-
- //set Owner
- }
-
- public Restriction getRestriction() {
+ }
+
+ public void setRestriction(Restriction restriction) {
+ if (restriction == null)
+ return;
+
+ restriction.setOwner(this);
+ if (this.restriction == null) {
+ this.restriction = restriction;
+ } else {
+ this.restriction.mergeWith(restriction);
+ }
+
+ }
+
+ public Restriction getRestriction() {
return restriction;
}