Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa
diff options
context:
space:
mode:
Diffstat (limited to 'jpa')
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlSequenceGenerator2_0.java6
2 files changed, 11 insertions, 7 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java
index 25bcbf709c..696357b668 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2010 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.
@@ -211,18 +211,18 @@ public abstract class AbstractOrmGenerator<T extends XmlGenerator>
return (XmlContextNode) super.getParent();
}
- public boolean overrides(Generator generator) {
- if (getName() == null) {
- return false;
- }
+ public boolean overrides(Generator other) {
// this isn't ideal, but it will have to do until we have further adopter input
- return this.getName().equals(generator.getName()) && generator instanceof JavaGenerator;
+ return (this.name != null)
+ && this.name.equals(other.getName())
+ && (other instanceof JavaGenerator);
}
public boolean duplicates(Generator other) {
return (this != other)
&& ! StringTools.stringIsEmpty(this.name)
&& this.name.equals(other.getName())
+ && ! this.isVirtual()
&& ! this.overrides(other)
&& ! other.overrides(this);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlSequenceGenerator2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlSequenceGenerator2_0.java
index 24ff515718..f2637eaf51 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlSequenceGenerator2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlSequenceGenerator2_0.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
+* Copyright (c) 2009, 2010 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.
@@ -103,4 +103,8 @@ public class VirtualXmlSequenceGenerator2_0 extends XmlSequenceGenerator
this.virtualXmlSequenceGenerator.setSequenceName(newSequenceName);
}
+ @Override
+ public boolean isVirtual() {
+ return this.virtualXmlSequenceGenerator.isVirtual();
+ }
}

Back to the top