Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2010-06-24 18:53:33 +0000
committerkmoore2010-06-24 18:53:33 +0000
commit3b916f1f1e82a0ff464d037bb27329fa0eb8d0cd (patch)
tree7d49c248a3d94ce79c32630117a43df5f548d75b
parent8972e09eb6796342ead73900caf33d98ada9d972 (diff)
downloadwebtools.dali-3b916f1f1e82a0ff464d037bb27329fa0eb8d0cd.tar.gz
webtools.dali-3b916f1f1e82a0ff464d037bb27329fa0eb8d0cd.tar.xz
webtools.dali-3b916f1f1e82a0ff464d037bb27329fa0eb8d0cd.zip
313799 - fix null text range IllegalArgumentException validating with generator defined in java and and entity defined in both orm.xml and eclipselink-orm.xml
-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