Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeMapping.java')
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeMapping.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeMapping.java
index 562ae7e94d..a071e1ce71 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeMapping.java
@@ -11,6 +11,7 @@ package org.eclipse.jpt.core.internal.context.orm;
import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
+import org.eclipse.jpt.core.resource.orm.AccessType;
import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
import org.eclipse.jpt.core.utility.TextRange;
@@ -21,12 +22,14 @@ public class VirtualXmlAttributeMapping extends AbstractJpaEObject implements Xm
protected final JavaAttributeMapping javaAttributeMapping;
+
public VirtualXmlAttributeMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
super();
this.ormTypeMapping = ormTypeMapping;
this.javaAttributeMapping = javaAttributeMapping;
}
+
protected boolean isOrmMetadataComplete() {
return this.ormTypeMapping.isMetadataComplete();
}
@@ -41,7 +44,7 @@ public class VirtualXmlAttributeMapping extends AbstractJpaEObject implements Xm
public String getName() {
return this.javaAttributeMapping.getPersistentAttribute().getName();
}
-
+
public void setName(String newName) {
throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
}
@@ -49,5 +52,13 @@ public class VirtualXmlAttributeMapping extends AbstractJpaEObject implements Xm
public TextRange getNameTextRange() {
return null;
}
-
+
+ public AccessType getAccess() {
+ return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(
+ this.javaAttributeMapping.getPersistentAttribute().getAccess());
+ }
+
+ public void setAccess(AccessType value) {
+ throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
+ }
}

Back to the top