Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/AccessType.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkAccessType.java16
2 files changed, 18 insertions, 13 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/AccessType.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/AccessType.java
index 470aff4b37..dd41a4e96a 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/AccessType.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/AccessType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2013 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.
@@ -13,7 +13,7 @@ import org.eclipse.jpt.common.core.JptResourceType;
import org.eclipse.jpt.jpa.core.JpaPlatform;
/**
- * Context model corresponding to:<ul>
+ * (Extensible) context model "enum" corresponding to:<ul>
* <li>the XML resource model
* {@link org.eclipse.jpt.jpa.core.resource.orm.AccessType},
* which corresponds to the <code>access</code> element in the
@@ -48,8 +48,8 @@ public class AccessType {
protected final String ormAccessType;
protected final String displayString;
- public AccessType(org.eclipse.jpt.jpa.core.resource.java.AccessType javaAccessType, String ormAccessType, String displayString) {
- if (ormAccessType == null) {
+ protected AccessType(org.eclipse.jpt.jpa.core.resource.java.AccessType javaAccessType, String ormAccessType, String displayString) {
+ if ((ormAccessType == null) || (displayString == null)) {
throw new NullPointerException();
}
this.javaAccessType = javaAccessType;
@@ -69,6 +69,12 @@ public class AccessType {
return this.displayString;
}
+ @Override
+ public String toString() {
+ return this.displayString;
+ }
+
+
// ********** static methods **********
public static AccessType fromJavaResourceModel(org.eclipse.jpt.jpa.core.resource.java.AccessType javaAccessType, JpaPlatform jpaPlatform, JptResourceType resourceType) {
@@ -104,5 +110,4 @@ public class AccessType {
public static String toOrmResourceModel(AccessType accessType) {
return (accessType == null) ? null : accessType.getOrmAccessType();
}
-
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkAccessType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkAccessType.java
index e897f3453f..934773c41c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkAccessType.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkAccessType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 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.
@@ -12,13 +12,12 @@ package org.eclipse.jpt.jpa.eclipselink.core.context;
import org.eclipse.jpt.jpa.core.context.AccessType;
/**
- * Context model corresponding to:<ul>
+ * (Extensible) context model "enum" corresponding to:<ul>
* <li>the XML resource model
* {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkAccessType},
* which corresponds to the <code>access</code> element in the
* <code>orm.xml</code> file.
- * <li>the Java resource model {@link org.eclipse.jpt.jpa.core.resource.java.AccessType}
- * which corresponds to the <code>javax.persistence.Access</code> annotation.
+ * <li>by definition, there is no corresponding Java resource model annotation.
* </ul>
* Provisional API: This interface is part of an interim API that is still
* under development and expected to change significantly before reaching
@@ -29,16 +28,17 @@ import org.eclipse.jpt.jpa.core.context.AccessType;
* @version 3.2
* @since 3.2
*/
-public class EclipseLinkAccessType extends AccessType {
-
- public static final AccessType VIRTUAL = new AccessType(
+public class EclipseLinkAccessType
+ extends AccessType
+{
+ public static final EclipseLinkAccessType VIRTUAL = new EclipseLinkAccessType(
null,
org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkAccessType.VIRTUAL,
"Virtual" //$NON-NLS-1$
);
- public EclipseLinkAccessType(org.eclipse.jpt.jpa.core.resource.java.AccessType javaAccessType, String ormAccessType, String displayString) {
+ private EclipseLinkAccessType(org.eclipse.jpt.jpa.core.resource.java.AccessType javaAccessType, String ormAccessType, String displayString) {
super(javaAccessType, ormAccessType, displayString);
}
}

Back to the top