Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfullbright2009-08-04 15:05:13 +0000
committerpfullbright2009-08-04 15:05:13 +0000
commit8f1f9c356e97be6e734b2fa12e6eb59994e91db9 (patch)
treea4f548dfb25a7caef3b04065b6c033105de01200 /jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullSpecifiedJavaAttributeMappingProvider.java
parentef7b5de41b75261ab5ee01711118316956c99a1b (diff)
downloadwebtools.dali-8f1f9c356e97be6e734b2fa12e6eb59994e91db9.tar.gz
webtools.dali-8f1f9c356e97be6e734b2fa12e6eb59994e91db9.tar.xz
webtools.dali-8f1f9c356e97be6e734b2fa12e6eb59994e91db9.zip
model framework changes necessary to support derived id's
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullSpecifiedJavaAttributeMappingProvider.java')
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullSpecifiedJavaAttributeMappingProvider.java71
1 files changed, 71 insertions, 0 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullSpecifiedJavaAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullSpecifiedJavaAttributeMappingProvider.java
new file mode 100644
index 0000000000..a36b941c17
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullSpecifiedJavaAttributeMappingProvider.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.context.java;
+
+import org.eclipse.jpt.core.JpaFactory;
+import org.eclipse.jpt.core.MappingKeys;
+
+/**
+ * This mapping provider implementation is used to describe the specified mapping for
+ * a java attribute when no other mapping applies.
+ */
+public class NullSpecifiedJavaAttributeMappingProvider
+ implements JavaAttributeMappingProvider
+{
+ // singleton
+ private static final NullSpecifiedJavaAttributeMappingProvider INSTANCE =
+ new NullSpecifiedJavaAttributeMappingProvider();
+
+
+ /**
+ * Return the singleton.
+ */
+ public static JavaAttributeMappingProvider instance() {
+ return INSTANCE;
+ }
+
+
+ /**
+ * Enforce singleton usage
+ */
+ private NullSpecifiedJavaAttributeMappingProvider() {
+ super();
+ }
+
+
+ public String getKey() {
+ return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
+ }
+
+ public String getAnnotationName() {
+ return null;
+ }
+
+ /**
+ * There is no specified mapping in this case, attributes should revert to the default
+ */
+ public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
+ return null;
+ }
+
+ /**
+ * Obviously false
+ */
+ public boolean defaultApplies(JavaPersistentAttribute persistentAttribute) {
+ return false;
+ }
+
+ /**
+ * This is typically the final test, so it should always apply
+ */
+ public boolean specifiedApplies(JavaPersistentAttribute persistentAttribute) {
+ return true;
+ }
+}

Back to the top