Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2011-06-24 12:02:58 +0000
committerkmoore2011-06-24 12:02:58 +0000
commit7d8b4c0024c5349c6e45cdcc374267c85705de90 (patch)
tree55b2acbb0ee5dc8aca32445b164b1f481bb66673
parent9c38e26cb3b19c0b7e988d8e5c3c16f7b52bf718 (diff)
downloadwebtools.dali-7d8b4c0024c5349c6e45cdcc374267c85705de90.tar.gz
webtools.dali-7d8b4c0024c5349c6e45cdcc374267c85705de90.tar.xz
webtools.dali-7d8b4c0024c5349c6e45cdcc374267c85705de90.zip
347814 - NPE: Change a mapping to many-to-one or one-to-one mapping - added null mapping name check for list of maps-ids
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java
index 379b240259..3578c83fe1 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java
@@ -23,7 +23,6 @@ import org.eclipse.jpt.jpa.core.MappingKeys;
import org.eclipse.jpt.jpa.core.context.AttributeMapping;
import org.eclipse.jpt.jpa.core.context.Embeddable;
import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
@@ -124,12 +123,18 @@ public class GenericOrmMapsIdDerivedIdentityStrategy2_0
}
protected Iterable<String> getAllAttributeMappingChoiceNames() {
- return new TransformationIterable<AttributeMapping, String>(this.getAllAttributeMappingChoices()) {
- @Override
- protected String transform(AttributeMapping mapping) {
- return mapping.getName();
- }
- };
+ return new FilteringIterable<String>(
+ new TransformationIterable<AttributeMapping, String>(this.getAllAttributeMappingChoices()) {
+ @Override
+ protected String transform(AttributeMapping mapping) {
+ return mapping.getName();
+ }
+ }) {
+ @Override
+ protected boolean accept(String o) {
+ return o != null;
+ }
+ };
}
protected Iterable<AttributeMapping> getAllAttributeMappingChoices() {

Back to the top