diff options
author | kmoore | 2008-11-11 15:47:21 +0000 |
---|---|---|
committer | kmoore | 2008-11-11 15:47:21 +0000 |
commit | 169f1e6618014fda6a10369c601ed41637b4306f (patch) | |
tree | d8f2cebaaaf212fc5b63fda9ff7021e87fb29cea | |
parent | 07caec2d1d7fab9d7db03fe1ff5f558432b1df0a (diff) | |
download | webtools.dali-169f1e6618014fda6a10369c601ed41637b4306f.tar.gz webtools.dali-169f1e6618014fda6a10369c601ed41637b4306f.tar.xz webtools.dali-169f1e6618014fda6a10369c601ed41637b4306f.zip |
254818 - basic UI for basic-collection, basic-map, and transformation mapping for eclipselink
68 files changed, 3051 insertions, 87 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmBasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmBasicMapping.java index bc2e3d644c..a6c4c7d54c 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmBasicMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmBasicMapping.java @@ -159,7 +159,7 @@ public class GenericOrmBasicMapping extends AbstractOrmAttributeMapping<XmlBasic } public int getXmlSequence() { - return 2; + return 20; } @Override @@ -251,9 +251,6 @@ public class GenericOrmBasicMapping extends AbstractOrmAttributeMapping<XmlBasic public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) { typeMapping.getAttributes().getBasics().remove(this.resourceAttributeMapping); - if (typeMapping.getAttributes().isAllFeaturesUnset()) { - typeMapping.setAttributes(null); - } } //***************** XmlColumn.Owner implementation **************** diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedIdMapping.java index 1be2a5598a..43c54996de 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedIdMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedIdMapping.java @@ -30,7 +30,7 @@ public class GenericOrmEmbeddedIdMapping extends AbstractOrmBaseEmbeddedMapping< } public int getXmlSequence() { - return 1; + return 10; } //*************** AttributeMapping implementation ********************* @@ -53,8 +53,5 @@ public class GenericOrmEmbeddedIdMapping extends AbstractOrmBaseEmbeddedMapping< public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) { typeMapping.getAttributes().getEmbeddedIds().remove(this.resourceAttributeMapping); - if (typeMapping.getAttributes().isAllFeaturesUnset()) { - typeMapping.setAttributes(null); - } } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedMapping.java index ccdeabc4db..0fd1fe3473 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedMapping.java @@ -30,7 +30,7 @@ public class GenericOrmEmbeddedMapping extends AbstractOrmBaseEmbeddedMapping<Xm } public int getXmlSequence() { - return 8; + return 80; } public String getKey() { @@ -46,8 +46,5 @@ public class GenericOrmEmbeddedMapping extends AbstractOrmBaseEmbeddedMapping<Xm public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) { typeMapping.getAttributes().getEmbeddeds().remove(this.resourceAttributeMapping); - if (typeMapping.getAttributes().isAllFeaturesUnset()) { - typeMapping.setAttributes(null); - } } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdMapping.java index 888e4d76d0..2c289c8832 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdMapping.java @@ -259,9 +259,6 @@ public class GenericOrmIdMapping public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) { typeMapping.getAttributes().getIds().remove(this.resourceAttributeMapping); - if (typeMapping.getAttributes().isAllFeaturesUnset()) { - typeMapping.setAttributes(null); - } } public Table getDbTable(String tableName) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyMapping.java index a9d65a368e..bcca1d98fe 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyMapping.java @@ -42,7 +42,7 @@ public class GenericOrmManyToManyMapping extends AbstractOrmMultiRelationshipMap } public int getXmlSequence() { - return 7; + return 70; } // ********** NonOwningMapping implementation ********** @@ -60,8 +60,5 @@ public class GenericOrmManyToManyMapping extends AbstractOrmMultiRelationshipMap public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) { typeMapping.getAttributes().getManyToManys().remove(this.resourceAttributeMapping); - if (typeMapping.getAttributes().isAllFeaturesUnset()) { - typeMapping.setAttributes(null); - } } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneMapping.java index d572a52527..96590c6dcc 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneMapping.java @@ -27,7 +27,7 @@ public class GenericOrmManyToOneMapping extends AbstractOrmSingleRelationshipMap } public int getXmlSequence() { - return 4; + return 40; } public String getKey() { @@ -57,8 +57,5 @@ public class GenericOrmManyToOneMapping extends AbstractOrmSingleRelationshipMap public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) { typeMapping.getAttributes().getManyToOnes().remove(this.resourceAttributeMapping); - if (typeMapping.getAttributes().isAllFeaturesUnset()) { - typeMapping.setAttributes(null); - } } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToManyMapping.java index 80561bf28c..7de784c1ff 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToManyMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToManyMapping.java @@ -43,7 +43,7 @@ public class GenericOrmOneToManyMapping extends AbstractOrmMultiRelationshipMapp } public int getXmlSequence() { - return 5; + return 50; } // ********** NonOwningMapping implementation ********** @@ -61,8 +61,5 @@ public class GenericOrmOneToManyMapping extends AbstractOrmMultiRelationshipMapp public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) { typeMapping.getAttributes().getOneToManys().remove(this.resourceAttributeMapping); - if (typeMapping.getAttributes().isAllFeaturesUnset()) { - typeMapping.setAttributes(null); - } } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneMapping.java index 3f2562c11c..237842b704 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneMapping.java @@ -148,7 +148,7 @@ public class GenericOrmOneToOneMapping } public int getXmlSequence() { - return 6; + return 60; } @Override @@ -171,9 +171,6 @@ public class GenericOrmOneToOneMapping public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) { typeMapping.getAttributes().getOneToOnes().remove(this.resourceAttributeMapping); - if (typeMapping.getAttributes().isAllFeaturesUnset()) { - typeMapping.setAttributes(null); - } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java index dd448ebdb4..71bc0a2c08 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java @@ -185,21 +185,13 @@ public class GenericOrmPersistentType public void changeMapping(OrmPersistentAttribute ormPersistentAttribute, OrmAttributeMapping oldMapping, OrmAttributeMapping newMapping) { int sourceIndex = this.specifiedPersistentAttributes.indexOf(ormPersistentAttribute); - if (sourceIndex != -1) { - this.specifiedPersistentAttributes.remove(sourceIndex); - oldMapping.removeFromResourceModel(getMapping().getResourceTypeMapping()); - } - if (getMapping().getResourceTypeMapping().getAttributes() == null) { - getMapping().getResourceTypeMapping().setAttributes(OrmFactory.eINSTANCE.createAttributes()); - } + this.specifiedPersistentAttributes.remove(sourceIndex); + oldMapping.removeFromResourceModel(this.ormTypeMapping.getResourceTypeMapping()); int targetIndex = insertionIndex(ormPersistentAttribute); this.specifiedPersistentAttributes.add(targetIndex, ormPersistentAttribute); newMapping.addToResourceModel(getMapping().getResourceTypeMapping()); oldMapping.initializeOn(newMapping); - if (sourceIndex != -1) { - //TODO are the source and target correct in this case, or is target off by one??? - fireItemMoved(SPECIFIED_ATTRIBUTES_LIST, targetIndex, sourceIndex); - } + fireItemMoved(SPECIFIED_ATTRIBUTES_LIST, targetIndex, sourceIndex); } public void makePersistentAttributeVirtual(OrmPersistentAttribute ormPersistentAttribute) { @@ -232,7 +224,7 @@ public class GenericOrmPersistentType OrmPersistentAttribute newPersistentAttribute = buildOrmPersistentAttribute(mappingKey); if (getMapping().getResourceTypeMapping().getAttributes() == null) { - getMapping().getResourceTypeMapping().setAttributes(OrmFactory.eINSTANCE.createAttributes()); + getMapping().getResourceTypeMapping().setAttributes(createAttributesResource()); } int insertionIndex = insertionIndex(newPersistentAttribute); this.specifiedPersistentAttributes.add(insertionIndex, newPersistentAttribute); @@ -246,6 +238,10 @@ public class GenericOrmPersistentType fireItemRemoved(VIRTUAL_ATTRIBUTES_LIST, removalIndex, ormPersistentAttribute); } + protected Attributes createAttributesResource() { + return OrmFactory.eINSTANCE.createAttributes(); + } + public Iterator<String> allAttributeNames() { return this.attributeNames(this.allAttributes()); } @@ -352,7 +348,7 @@ public class GenericOrmPersistentType OrmPersistentAttribute persistentAttribute = buildOrmPersistentAttribute(mappingKey); int index = insertionIndex(persistentAttribute); if (getMapping().getResourceTypeMapping().getAttributes() == null) { - getMapping().getResourceTypeMapping().setAttributes(OrmFactory.eINSTANCE.createAttributes()); + getMapping().getResourceTypeMapping().setAttributes(createAttributesResource()); } this.specifiedPersistentAttributes.add(index, persistentAttribute); persistentAttribute.getMapping().addToResourceModel(getMapping().getResourceTypeMapping()); @@ -399,6 +395,9 @@ public class GenericOrmPersistentType int index = this.specifiedPersistentAttributes.indexOf(ormPersistentAttribute); this.specifiedPersistentAttributes.remove(ormPersistentAttribute); ormPersistentAttribute.getMapping().removeFromResourceModel(this.ormTypeMapping.getResourceTypeMapping()); + if (this.ormTypeMapping.getResourceTypeMapping().getAttributes().isAllFeaturesUnset()) { + this.ormTypeMapping.getResourceTypeMapping().setAttributes(null); + } fireItemRemoved(PersistentType.SPECIFIED_ATTRIBUTES_LIST, index, ormPersistentAttribute); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTransientMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTransientMapping.java index aedb509962..7608af1c04 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTransientMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTransientMapping.java @@ -30,7 +30,7 @@ public class GenericOrmTransientMapping extends AbstractOrmAttributeMapping<XmlT } public int getXmlSequence() { - return 9; + return 90; } public String getKey() { @@ -46,8 +46,5 @@ public class GenericOrmTransientMapping extends AbstractOrmAttributeMapping<XmlT public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) { typeMapping.getAttributes().getTransients().remove(this.resourceAttributeMapping); - if (typeMapping.getAttributes().isAllFeaturesUnset()) { - typeMapping.setAttributes(null); - } } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmVersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmVersionMapping.java index df2b996a8f..a7a6e0ef20 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmVersionMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmVersionMapping.java @@ -43,7 +43,7 @@ public class GenericOrmVersionMapping extends AbstractOrmAttributeMapping<XmlVer } public int getXmlSequence() { - return 3; + return 30; } public String getKey() { @@ -115,9 +115,6 @@ public class GenericOrmVersionMapping extends AbstractOrmAttributeMapping<XmlVer public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) { typeMapping.getAttributes().getVersions().remove(this.resourceAttributeMapping); - if (typeMapping.getAttributes().isAllFeaturesUnset()) { - typeMapping.setAttributes(null); - } } public String getDefaultColumnName() { diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipselink_orm.ecore b/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipselink_orm.ecore index 5e8e30f77d..26a96e9994 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipselink_orm.ecore +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipselink_orm.ecore @@ -172,4 +172,21 @@ <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany" abstract="true" interface="true" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlManyToMany #//XmlJoinFetch"/> <eClassifiers xsi:type="ecore:EClass" name="XmlManyToManyImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlManyToManyImpl #//XmlManyToMany"/> + <eClassifiers xsi:type="ecore:EClass" name="Attributes" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//Attributes"> + <eStructuralFeatures xsi:type="ecore:EReference" name="basicCollections" upperBound="-1" + eType="#//XmlBasicCollection" containment="true" resolveProxies="false"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="basicMaps" upperBound="-1" + eType="#//XmlBasicMap" containment="true" resolveProxies="false"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="transformations" upperBound="-1" + eType="#//XmlTransformation" containment="true" resolveProxies="false"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="XmlBasicCollection" abstract="true" + interface="true" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlAttributeMapping"/> + <eClassifiers xsi:type="ecore:EClass" name="XmlBasicCollectionImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlBasicCollection"/> + <eClassifiers xsi:type="ecore:EClass" name="XmlBasicMap" abstract="true" interface="true" + eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlAttributeMapping"/> + <eClassifiers xsi:type="ecore:EClass" name="XmlBasicMapImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlBasicMap"/> + <eClassifiers xsi:type="ecore:EClass" name="XmlTransformation" abstract="true" interface="true" + eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlAttributeMapping"/> + <eClassifiers xsi:type="ecore:EClass" name="XmlTransformationImpl" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlTransformation"/> </ecore:EPackage> diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/jptEclipseLinkResourceModels.genmodel b/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/jptEclipseLinkResourceModels.genmodel index 0e9d1f0623..f321353bee 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/jptEclipseLinkResourceModels.genmodel +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/jptEclipseLinkResourceModels.genmodel @@ -148,5 +148,16 @@ <genClasses ecoreClass="eclipselink_orm.ecore#//XmlManyToOneImpl"/> <genClasses ecoreClass="eclipselink_orm.ecore#//XmlManyToMany"/> <genClasses ecoreClass="eclipselink_orm.ecore#//XmlManyToManyImpl"/> + <genClasses ecoreClass="eclipselink_orm.ecore#//Attributes"> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//Attributes/basicCollections"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//Attributes/basicMaps"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//Attributes/transformations"/> + </genClasses> + <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlBasicCollection"/> + <genClasses ecoreClass="eclipselink_orm.ecore#//XmlBasicCollectionImpl"/> + <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlBasicMap"/> + <genClasses ecoreClass="eclipselink_orm.ecore#//XmlBasicMapImpl"/> + <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlTransformation"/> + <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTransformationImpl"/> </genPackages> </genmodel:GenModel> diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkMappingKeys.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkMappingKeys.java new file mode 100644 index 0000000000..7aaa7f4351 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkMappingKeys.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core; + +/** + * + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + */ +@SuppressWarnings("nls") +public interface EclipseLinkMappingKeys { + + String BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY = "basicCollection"; + String BASIC_MAP_ATTRIBUTE_MAPPING_KEY = "basicMap"; + String TRANSFORMATION_ATTRIBUTE_MAPPING_KEY = "transformation"; +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicCollectionMapping.java new file mode 100644 index 0000000000..e396ef0d7c --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicCollectionMapping.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.context; + +import org.eclipse.jpt.core.context.AttributeMapping; + +/** + * + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + * + * @version 2.1 + * @since 2.1 + */ +public interface BasicCollectionMapping extends AttributeMapping +{ +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicMapMapping.java new file mode 100644 index 0000000000..f9a37b3d73 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/BasicMapMapping.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.context; + +import org.eclipse.jpt.core.context.AttributeMapping; + +/** + * + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + * + * @version 2.1 + * @since 2.1 + */ +public interface BasicMapMapping extends AttributeMapping +{ +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TransformationMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TransformationMapping.java new file mode 100644 index 0000000000..d2f8015cc3 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/TransformationMapping.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.context; + +import org.eclipse.jpt.core.context.AttributeMapping; + +/** + * + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + * + * @version 2.1 + * @since 2.1 + */ +public interface TransformationMapping extends AttributeMapping +{ +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaAnnotationProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaAnnotationProvider.java index 35455c37f2..dd614ea98d 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaAnnotationProvider.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaAnnotationProvider.java @@ -13,6 +13,8 @@ import java.util.List; import org.eclipse.jpt.core.internal.platform.GenericJpaAnnotationProvider; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; +import org.eclipse.jpt.eclipselink.core.internal.resource.java.BasicCollectionImpl.BasicCollectionAnnotationDefinition; +import org.eclipse.jpt.eclipselink.core.internal.resource.java.BasicMapImpl.BasicMapAnnotationDefinition; import org.eclipse.jpt.eclipselink.core.internal.resource.java.CacheImpl.CacheAnnotationDefinition; import org.eclipse.jpt.eclipselink.core.internal.resource.java.ChangeTrackingImpl.ChangeTrackingAnnotationDefinition; import org.eclipse.jpt.eclipselink.core.internal.resource.java.ConvertImpl.ConvertAnnotationDefinition; @@ -52,6 +54,8 @@ public class EclipseLinkJpaAnnotationProvider @Override protected void addAttributeMappingAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) { super.addAttributeMappingAnnotationDefinitionsTo(definitions); + definitions.add(BasicCollectionAnnotationDefinition.instance()); + definitions.add(BasicMapAnnotationDefinition.instance()); definitions.add(TransformationAnnotationDefinition.instance()); } diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactory.java index 330bd7e8bc..32f9195aef 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactory.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactory.java @@ -33,6 +33,7 @@ import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping; import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping; import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute; import org.eclipse.jpt.core.context.orm.OrmPersistentType; +import org.eclipse.jpt.core.context.orm.OrmPersistentTypeContext; import org.eclipse.jpt.core.context.orm.OrmTypeMapping; import org.eclipse.jpt.core.context.orm.OrmVersionMapping; import org.eclipse.jpt.core.context.orm.OrmXml; @@ -53,6 +54,8 @@ import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit; import org.eclipse.jpt.eclipselink.core.EclipseLinkJpaFile; import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaEntity; import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaMappedSuperclass; +import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicCollectionMapping; +import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicMapMapping; import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingImpl; import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableImpl; import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaEntityImpl; @@ -62,8 +65,11 @@ import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaMan import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassImpl; import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingImpl; import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingImpl; +import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaTransformationMapping; import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingImpl; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkEntityMappingsImpl; +import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmBasicCollectionMapping; +import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmBasicMapMapping; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmBasicMapping; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmEmbeddableImpl; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmEntityImpl; @@ -73,17 +79,25 @@ import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmManyT import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmMappedSuperclassImpl; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmOneToManyMapping; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmOneToOneMapping; +import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmPersistentType; +import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmTransformationMapping; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmVersionMapping; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmXml; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlBasic; +import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualXmlBasicCollection; +import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualXmlBasicMap; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlId; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlManyToMany; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlManyToOne; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlOneToMany; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlOneToOne; +import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualXmlTransformation; import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkVirtualXmlVersion; import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit; import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmResource; +import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection; +import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap; +import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation; public class EclipseLinkJpaFactory extends GenericJpaFactory @@ -184,6 +198,11 @@ public class EclipseLinkJpaFactory // **************** eclipselink orm context objects ************************ + + @Override + public OrmPersistentType buildOrmPersistentType(OrmPersistentTypeContext parent, String mappingKey) { + return new EclipseLinkOrmPersistentType(parent, mappingKey); + } @Override public OrmEmbeddable buildOrmEmbeddable(OrmPersistentType parent) { @@ -317,4 +336,40 @@ public class EclipseLinkJpaFactory public JavaManyToOneMapping buildJavaManyToOneMapping(JavaPersistentAttribute parent) { return new EclipseLinkJavaManyToOneMappingImpl(parent); } + + public JavaBasicCollectionMapping buildJavaBasicCollectionMapping(JavaPersistentAttribute parent) { + return new JavaBasicCollectionMapping(parent); + } + + public JavaBasicMapMapping buildJavaBasicMapMapping(JavaPersistentAttribute parent) { + return new JavaBasicMapMapping(parent); + } + + public JavaTransformationMapping buildJavaTransformationMapping(JavaPersistentAttribute parent) { + return new JavaTransformationMapping(parent); + } + + public OrmBasicCollectionMapping buildOrmBasicCollectionMapping(OrmPersistentAttribute parent) { + return new OrmBasicCollectionMapping(parent); + } + + public OrmBasicMapMapping buildOrmBasicMapMapping(OrmPersistentAttribute parent) { + return new OrmBasicMapMapping(parent); + } + + public OrmTransformationMapping buildOrmTransformationMapping(OrmPersistentAttribute parent) { + return new OrmTransformationMapping(parent); + } + + public XmlBasicCollection buildVirtualXmlBasicCollection(OrmTypeMapping ormTypeMapping, JavaBasicCollectionMapping javaBasicCollectionMapping) { + return new VirtualXmlBasicCollection(ormTypeMapping, javaBasicCollectionMapping); + } + + public XmlBasicMap buildVirtualXmlBasicMap(OrmTypeMapping ormTypeMapping, JavaBasicMapMapping javaBasicMapMapping) { + return new VirtualXmlBasicMap(ormTypeMapping, javaBasicMapMapping); + } + + public XmlTransformation buildVirtualXmlTransformation(OrmTypeMapping ormTypeMapping, JavaTransformationMapping javaTransformationMapping) { + return new VirtualXmlTransformation(ormTypeMapping, javaTransformationMapping); + } } diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatform.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatform.java index 8fdec689ff..94f8d39ea5 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatform.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatform.java @@ -10,14 +10,21 @@ package org.eclipse.jpt.eclipselink.core.internal; import java.util.List; - import org.eclipse.jpt.core.JpaAnnotationProvider; import org.eclipse.jpt.core.JpaFactory; import org.eclipse.jpt.core.JpaFileProvider; import org.eclipse.jpt.core.context.java.DefaultJavaAttributeMappingProvider; +import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider; +import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider; import org.eclipse.jpt.core.internal.platform.GenericJpaPlatform; import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingProvider; import org.eclipse.jpt.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingProvider; +import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicCollectionMappingProvider; +import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicMapMappingProvider; +import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaTransformationMappingProvider; +import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmBasicCollectionMappingProvider; +import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmBasicMapMappingProvider; +import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmTransformationMappingProvider; /** * EclipseLink platform @@ -57,11 +64,26 @@ public class EclipseLinkJpaPlatform } @Override + protected void addJavaAttributeMappingProvidersTo(List<JavaAttributeMappingProvider> providers) { + super.addJavaAttributeMappingProvidersTo(providers); + providers.add(JavaBasicCollectionMappingProvider.instance()); + providers.add(JavaBasicMapMappingProvider.instance()); + providers.add(JavaTransformationMappingProvider.instance()); + } + + @Override protected void addDefaultJavaAttributeMappingProvidersTo(List<DefaultJavaAttributeMappingProvider> providers) { providers.add(EclipseLinkJavaOneToOneMappingProvider.instance()); providers.add(EclipseLinkJavaOneToManyMappingProvider.instance()); //add these before calling super, want to check for Basic last in case the reference object is Serializable super.addDefaultJavaAttributeMappingProvidersTo(providers); } - + + @Override + protected void addOrmAttributeMappingProvidersTo(List<OrmAttributeMappingProvider> providers) { + super.addOrmAttributeMappingProvidersTo(providers); + providers.add(OrmBasicCollectionMappingProvider.instance()); + providers.add(OrmBasicMapMappingProvider.instance()); + providers.add(OrmTransformationMappingProvider.instance()); + } } diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMapping.java new file mode 100644 index 0000000000..6f193da06b --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMapping.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.java; + +import java.util.Iterator; +import org.eclipse.jpt.core.context.java.JavaPersistentAttribute; +import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.context.BasicCollectionMapping; +import org.eclipse.jpt.eclipselink.core.resource.java.BasicCollectionAnnotation; +import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; + +public class JavaBasicCollectionMapping extends AbstractJavaAttributeMapping<BasicCollectionAnnotation> implements BasicCollectionMapping +{ + + public JavaBasicCollectionMapping(JavaPersistentAttribute parent) { + super(parent); + } + + public String getKey() { + return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY; + } + + public String getAnnotationName() { + return BasicCollectionAnnotation.ANNOTATION_NAME; + } + + public Iterator<String> correspondingAnnotationNames() { + return EmptyIterator.instance(); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMappingProvider.java new file mode 100644 index 0000000000..b2c084cc27 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicCollectionMappingProvider.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.java; + +import org.eclipse.jpt.core.JpaFactory; +import org.eclipse.jpt.core.context.java.JavaAttributeMapping; +import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider; +import org.eclipse.jpt.core.context.java.JavaPersistentAttribute; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory; +import org.eclipse.jpt.eclipselink.core.resource.java.BasicCollectionAnnotation; + +public class JavaBasicCollectionMappingProvider + implements JavaAttributeMappingProvider +{ + + // singleton + private static final JavaBasicCollectionMappingProvider INSTANCE = new JavaBasicCollectionMappingProvider(); + + /** + * Return the singleton. + */ + public static JavaAttributeMappingProvider instance() { + return INSTANCE; + } + + /** + * Ensure single instance. + */ + private JavaBasicCollectionMappingProvider() { + super(); + } + + public String getKey() { + return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY; + } + + public String getAnnotationName() { + return BasicCollectionAnnotation.ANNOTATION_NAME; + } + + public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) { + return ((EclipseLinkJpaFactory) factory).buildJavaBasicCollectionMapping(parent); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMapping.java new file mode 100644 index 0000000000..0fda365086 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMapping.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.java; + +import java.util.Iterator; +import org.eclipse.jpt.core.context.java.JavaPersistentAttribute; +import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.context.BasicMapMapping; +import org.eclipse.jpt.eclipselink.core.resource.java.BasicMapAnnotation; +import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; + +public class JavaBasicMapMapping extends AbstractJavaAttributeMapping<BasicMapAnnotation> implements BasicMapMapping +{ + + public JavaBasicMapMapping(JavaPersistentAttribute parent) { + super(parent); + } + + public String getKey() { + return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY; + } + + public String getAnnotationName() { + return BasicMapAnnotation.ANNOTATION_NAME; + } + + public Iterator<String> correspondingAnnotationNames() { + return EmptyIterator.instance(); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMappingProvider.java new file mode 100644 index 0000000000..7c1eadad99 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaBasicMapMappingProvider.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.java; + +import org.eclipse.jpt.core.JpaFactory; +import org.eclipse.jpt.core.context.java.JavaAttributeMapping; +import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider; +import org.eclipse.jpt.core.context.java.JavaPersistentAttribute; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory; +import org.eclipse.jpt.eclipselink.core.resource.java.BasicMapAnnotation; + +public class JavaBasicMapMappingProvider + implements JavaAttributeMappingProvider +{ + + // singleton + private static final JavaBasicMapMappingProvider INSTANCE = new JavaBasicMapMappingProvider(); + + /** + * Return the singleton. + */ + public static JavaAttributeMappingProvider instance() { + return INSTANCE; + } + + /** + * Ensure single instance. + */ + private JavaBasicMapMappingProvider() { + super(); + } + + public String getKey() { + return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY; + } + + public String getAnnotationName() { + return BasicMapAnnotation.ANNOTATION_NAME; + } + + public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) { + return ((EclipseLinkJpaFactory) factory).buildJavaBasicMapMapping(parent); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMapping.java new file mode 100644 index 0000000000..8e5d78fcd2 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMapping.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.java; + +import java.util.Iterator; +import org.eclipse.jpt.core.context.java.JavaPersistentAttribute; +import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.context.TransformationMapping; +import org.eclipse.jpt.eclipselink.core.resource.java.TransformationAnnotation; +import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; + +public class JavaTransformationMapping extends AbstractJavaAttributeMapping<TransformationAnnotation> implements TransformationMapping +{ + + public JavaTransformationMapping(JavaPersistentAttribute parent) { + super(parent); + } + + public String getKey() { + return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY; + } + + public String getAnnotationName() { + return TransformationAnnotation.ANNOTATION_NAME; + } + + public Iterator<String> correspondingAnnotationNames() { + return EmptyIterator.instance(); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMappingProvider.java new file mode 100644 index 0000000000..ea3f9ee390 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaTransformationMappingProvider.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.java; + +import org.eclipse.jpt.core.JpaFactory; +import org.eclipse.jpt.core.context.java.JavaAttributeMapping; +import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider; +import org.eclipse.jpt.core.context.java.JavaPersistentAttribute; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory; +import org.eclipse.jpt.eclipselink.core.resource.java.TransformationAnnotation; + +public class JavaTransformationMappingProvider + implements JavaAttributeMappingProvider +{ + + // singleton + private static final JavaTransformationMappingProvider INSTANCE = new JavaTransformationMappingProvider(); + + /** + * Return the singleton. + */ + public static JavaAttributeMappingProvider instance() { + return INSTANCE; + } + + /** + * Ensure single instance. + */ + private JavaTransformationMappingProvider() { + super(); + } + + public String getKey() { + return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY; + } + + public String getAnnotationName() { + return TransformationAnnotation.ANNOTATION_NAME; + } + + public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) { + return ((EclipseLinkJpaFactory) factory).buildJavaTransformationMapping(parent); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentType.java new file mode 100644 index 0000000000..f02d132bd3 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentType.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.orm; + +import org.eclipse.jpt.core.context.PersistentTypeContext; +import org.eclipse.jpt.core.internal.context.orm.GenericOrmPersistentType; +import org.eclipse.jpt.core.resource.orm.Attributes; +import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory; + +public class EclipseLinkOrmPersistentType extends GenericOrmPersistentType +{ + + public EclipseLinkOrmPersistentType(PersistentTypeContext parent, String mappingKey) { + super(parent, mappingKey); + } + + @Override + protected Attributes createAttributesResource() { + return EclipseLinkOrmFactory.eINSTANCE.createAttributes(); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicCollectionMapping.java new file mode 100644 index 0000000000..3d7a588765 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicCollectionMapping.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.orm; + +import org.eclipse.jpt.core.context.orm.OrmAttributeMapping; +import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAttributeMapping; +import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.context.BasicCollectionMapping; +import org.eclipse.jpt.eclipselink.core.resource.orm.Attributes; +import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory; +import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection; + +public class OrmBasicCollectionMapping extends AbstractOrmAttributeMapping<XmlBasicCollection> implements BasicCollectionMapping +{ + + public OrmBasicCollectionMapping(OrmPersistentAttribute parent) { + super(parent); + } + + public void initializeOn(OrmAttributeMapping newMapping) { + newMapping.initializeFromOrmAttributeMapping(this); + } + + public String getKey() { + return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY; + } + + public XmlBasicCollection addToResourceModel(AbstractXmlTypeMapping typeMapping) { + XmlBasicCollection basicCollection = EclipseLinkOrmFactory.eINSTANCE.createXmlBasicCollectionImpl(); + getPersistentAttribute().initialize(basicCollection); + ((Attributes) typeMapping.getAttributes()).getBasicCollections().add(basicCollection); + return basicCollection; + } + + public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) { + ((Attributes) typeMapping.getAttributes()).getBasicCollections().remove(this.resourceAttributeMapping); + } + + public int getXmlSequence() { + return 23; + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicCollectionMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicCollectionMappingProvider.java new file mode 100644 index 0000000000..69f3f638cb --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicCollectionMappingProvider.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.orm; + +import org.eclipse.jpt.core.JpaFactory; +import org.eclipse.jpt.core.context.java.JavaAttributeMapping; +import org.eclipse.jpt.core.context.orm.OrmAttributeMapping; +import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider; +import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.core.context.orm.OrmTypeMapping; +import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory; +import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicCollectionMapping; + +public class OrmBasicCollectionMappingProvider + implements OrmAttributeMappingProvider +{ + + // singleton + private static final OrmBasicCollectionMappingProvider INSTANCE = new OrmBasicCollectionMappingProvider(); + + /** + * Return the singleton. + */ + public static OrmAttributeMappingProvider instance() { + return INSTANCE; + } + + /** + * Ensure single instance. + */ + private OrmBasicCollectionMappingProvider() { + super(); + } + + public String getKey() { + return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY; + } + + public OrmAttributeMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) { + return ((EclipseLinkJpaFactory) factory).buildOrmBasicCollectionMapping(parent); + } + + public XmlAttributeMapping buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) { + return ((EclipseLinkJpaFactory) factory).buildVirtualXmlBasicCollection(ormTypeMapping, (JavaBasicCollectionMapping) javaAttributeMapping); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMapping.java new file mode 100644 index 0000000000..6294f48e81 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMapping.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.orm; + +import org.eclipse.jpt.core.context.orm.OrmAttributeMapping; +import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAttributeMapping; +import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.context.BasicMapMapping; +import org.eclipse.jpt.eclipselink.core.resource.orm.Attributes; +import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory; +import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap; + +public class OrmBasicMapMapping extends AbstractOrmAttributeMapping<XmlBasicMap> implements BasicMapMapping +{ + + public OrmBasicMapMapping(OrmPersistentAttribute parent) { + super(parent); + } + + public void initializeOn(OrmAttributeMapping newMapping) { + newMapping.initializeFromOrmAttributeMapping(this); + } + + public String getKey() { + return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY; + } + + public XmlBasicMap addToResourceModel(AbstractXmlTypeMapping typeMapping) { + XmlBasicMap basicMap = EclipseLinkOrmFactory.eINSTANCE.createXmlBasicMapImpl(); + getPersistentAttribute().initialize(basicMap); + ((Attributes) typeMapping.getAttributes()).getBasicMaps().add(basicMap); + return basicMap; + } + + public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) { + ((Attributes) typeMapping.getAttributes()).getBasicMaps().remove(this.resourceAttributeMapping); + } + + + public int getXmlSequence() { + return 27; + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMappingProvider.java new file mode 100644 index 0000000000..087f5c9cfc --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmBasicMapMappingProvider.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.orm; + +import org.eclipse.jpt.core.JpaFactory; +import org.eclipse.jpt.core.context.java.JavaAttributeMapping; +import org.eclipse.jpt.core.context.orm.OrmAttributeMapping; +import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider; +import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.core.context.orm.OrmTypeMapping; +import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory; +import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicMapMapping; + +public class OrmBasicMapMappingProvider + implements OrmAttributeMappingProvider +{ + + // singleton + private static final OrmBasicMapMappingProvider INSTANCE = new OrmBasicMapMappingProvider(); + + /** + * Return the singleton. + */ + public static OrmAttributeMappingProvider instance() { + return INSTANCE; + } + + /** + * Ensure single instance. + */ + private OrmBasicMapMappingProvider() { + super(); + } + + public String getKey() { + return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY; + } + + public OrmAttributeMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) { + return ((EclipseLinkJpaFactory) factory).buildOrmBasicMapMapping(parent); + } + + public XmlAttributeMapping buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) { + return ((EclipseLinkJpaFactory) factory).buildVirtualXmlBasicMap(ormTypeMapping, (JavaBasicMapMapping) javaAttributeMapping); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmTransformationMapping.java new file mode 100644 index 0000000000..9c37b0bed5 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmTransformationMapping.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.orm; + +import org.eclipse.jpt.core.context.orm.OrmAttributeMapping; +import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAttributeMapping; +import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.context.TransformationMapping; +import org.eclipse.jpt.eclipselink.core.resource.orm.Attributes; +import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory; +import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation; + +public class OrmTransformationMapping extends AbstractOrmAttributeMapping<XmlTransformation> implements TransformationMapping +{ + + public OrmTransformationMapping(OrmPersistentAttribute parent) { + super(parent); + } + + public void initializeOn(OrmAttributeMapping newMapping) { + newMapping.initializeFromOrmAttributeMapping(this); + } + + public String getKey() { + return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY; + } + + public XmlTransformation addToResourceModel(AbstractXmlTypeMapping typeMapping) { + XmlTransformation transformation = EclipseLinkOrmFactory.eINSTANCE.createXmlTransformationImpl(); + getPersistentAttribute().initialize(transformation); + ((Attributes) typeMapping.getAttributes()).getTransformations().add(transformation); + return transformation; + } + + public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) { + ((Attributes) typeMapping.getAttributes()).getTransformations().remove(this.resourceAttributeMapping); + } + + + public int getXmlSequence() { + return 85; + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmTransformationMappingProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmTransformationMappingProvider.java new file mode 100644 index 0000000000..f156c2ca37 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmTransformationMappingProvider.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.orm; + +import org.eclipse.jpt.core.JpaFactory; +import org.eclipse.jpt.core.context.java.JavaAttributeMapping; +import org.eclipse.jpt.core.context.orm.OrmAttributeMapping; +import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider; +import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.core.context.orm.OrmTypeMapping; +import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory; +import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaTransformationMapping; + +public class OrmTransformationMappingProvider + implements OrmAttributeMappingProvider +{ + + // singleton + private static final OrmTransformationMappingProvider INSTANCE = new OrmTransformationMappingProvider(); + + /** + * Return the singleton. + */ + public static OrmAttributeMappingProvider instance() { + return INSTANCE; + } + + /** + * Ensure single instance. + */ + private OrmTransformationMappingProvider() { + super(); + } + + public String getKey() { + return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY; + } + + public OrmAttributeMapping buildMapping(OrmPersistentAttribute parent, JpaFactory factory) { + return ((EclipseLinkJpaFactory) factory).buildOrmTransformationMapping(parent); + } + + public XmlAttributeMapping buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, JpaFactory factory) { + return ((EclipseLinkJpaFactory) factory).buildVirtualXmlTransformation(ormTypeMapping, (JavaTransformationMapping) javaAttributeMapping); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicCollection.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicCollection.java new file mode 100644 index 0000000000..65eded5257 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicCollection.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.orm; + +import org.eclipse.jpt.core.context.orm.OrmTypeMapping; +import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeMapping; +import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicCollectionMapping; +import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection; + +/** + * VirtualBasic is an implementation of Basic used when there is + * no tag in the orm.xml and an underlying javaBasicMapping exists. + */ +public class VirtualXmlBasicCollection extends VirtualXmlAttributeMapping<JavaBasicCollectionMapping> implements XmlBasicCollection +{ + + public VirtualXmlBasicCollection(OrmTypeMapping ormTypeMapping, JavaBasicCollectionMapping javaBasicCollectionMapping) { + super(ormTypeMapping, javaBasicCollectionMapping); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicMap.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicMap.java new file mode 100644 index 0000000000..34abe15de7 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlBasicMap.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.orm; + +import org.eclipse.jpt.core.context.orm.OrmTypeMapping; +import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeMapping; +import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaBasicMapMapping; +import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap; + +/** + * VirtualBasic is an implementation of Basic used when there is + * no tag in the orm.xml and an underlying javaBasicMapping exists. + */ +public class VirtualXmlBasicMap extends VirtualXmlAttributeMapping<JavaBasicMapMapping> implements XmlBasicMap +{ + + public VirtualXmlBasicMap(OrmTypeMapping ormTypeMapping, JavaBasicMapMapping javaBasicMapMappingg) { + super(ormTypeMapping, javaBasicMapMappingg); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlTransformation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlTransformation.java new file mode 100644 index 0000000000..db4ae6ecb0 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualXmlTransformation.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.context.orm; + +import org.eclipse.jpt.core.context.orm.OrmTypeMapping; +import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeMapping; +import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaTransformationMapping; +import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation; + +/** + * VirtualBasic is an implementation of Basic used when there is + * no tag in the orm.xml and an underlying javaBasicMapping exists. + */ +public class VirtualXmlTransformation extends VirtualXmlAttributeMapping<JavaTransformationMapping> implements XmlTransformation +{ + + public VirtualXmlTransformation(OrmTypeMapping ormTypeMapping, JavaTransformationMapping javaTransformationMapping) { + super(ormTypeMapping, javaTransformationMapping); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/BasicCollectionImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/BasicCollectionImpl.java new file mode 100644 index 0000000000..7c1b219557 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/BasicCollectionImpl.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.resource.java; + +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation; +import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; +import org.eclipse.jpt.core.resource.java.Annotation; +import org.eclipse.jpt.core.resource.java.AnnotationDefinition; +import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; +import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.Attribute; +import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.eclipselink.core.resource.java.BasicCollectionAnnotation; + + +public class BasicCollectionImpl extends AbstractResourceAnnotation<Attribute> implements BasicCollectionAnnotation +{ + private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + + + protected BasicCollectionImpl(JavaResourcePersistentAttribute parent, Attribute attribute) { + super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); + } + + public void initialize(CompilationUnit astRoot) { + } + + public String getAnnotationName() { + return ANNOTATION_NAME; + } + + public void update(CompilationUnit astRoot) { + } + + public static class BasicCollectionAnnotationDefinition implements AnnotationDefinition + { + // singleton + private static final BasicCollectionAnnotationDefinition INSTANCE = new BasicCollectionAnnotationDefinition(); + + /** + * Return the singleton. + */ + public static BasicCollectionAnnotationDefinition instance() { + return INSTANCE; + } + + /** + * Ensure single instance. + */ + private BasicCollectionAnnotationDefinition() { + super(); + } + + public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { + return new BasicCollectionImpl((JavaResourcePersistentAttribute) parent, (Attribute) member); + } + + public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) { + return null; + } + + public String getAnnotationName() { + return ANNOTATION_NAME; + } + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/BasicMapImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/BasicMapImpl.java new file mode 100644 index 0000000000..3fd7d631ea --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/BasicMapImpl.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.resource.java; + +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jpt.core.internal.resource.java.AbstractResourceAnnotation; +import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; +import org.eclipse.jpt.core.resource.java.Annotation; +import org.eclipse.jpt.core.resource.java.AnnotationDefinition; +import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; +import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.Attribute; +import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.eclipselink.core.resource.java.BasicMapAnnotation; + + +public class BasicMapImpl extends AbstractResourceAnnotation<Attribute> implements BasicMapAnnotation +{ + private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + + + protected BasicMapImpl(JavaResourcePersistentAttribute parent, Attribute attribute) { + super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); + } + + public void initialize(CompilationUnit astRoot) { + } + + public String getAnnotationName() { + return ANNOTATION_NAME; + } + + public void update(CompilationUnit astRoot) { + } + + public static class BasicMapAnnotationDefinition implements AnnotationDefinition + { + // singleton + private static final BasicMapAnnotationDefinition INSTANCE = new BasicMapAnnotationDefinition(); + + /** + * Return the singleton. + */ + public static BasicMapAnnotationDefinition instance() { + return INSTANCE; + } + + /** + * Ensure single instance. + */ + private BasicMapAnnotationDefinition() { + super(); + } + + public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { + return new BasicMapImpl((JavaResourcePersistentAttribute) parent, (Attribute) member); + } + + public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) { + return null; + } + + public String getAnnotationName() { + return ANNOTATION_NAME; + } + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicCollectionTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicCollectionTranslator.java new file mode 100644 index 0000000000..b18deca31a --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicCollectionTranslator.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.resource.orm.translators; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory; +import org.eclipse.wst.common.internal.emf.resource.Translator; + +public class BasicCollectionTranslator extends Translator + implements EclipseLinkOrmXmlMapper +{ + private Translator[] children; + + public BasicCollectionTranslator(String domNameAndPath, EStructuralFeature aFeature) { + super(domNameAndPath, aFeature); + } + + @Override + public EObject createEMFObject(String nodeName, String readAheadName) { + return EclipseLinkOrmFactory.eINSTANCE.createXmlBasicCollectionImpl(); + } + + @Override + protected Translator[] getChildren() { + if (this.children == null) { + this.children = createChildren(); + } + return this.children; + } + + protected Translator[] createChildren() { + return new Translator[] { + createNameTranslator() + }; + } + + protected Translator createNameTranslator() { + return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicMapTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicMapTranslator.java new file mode 100644 index 0000000000..3c244c1c84 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/BasicMapTranslator.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.resource.orm.translators; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.jpt.core.internal.resource.orm.translators.BasicTranslator; +import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory; +import org.eclipse.wst.common.internal.emf.resource.Translator; + +public class BasicMapTranslator extends BasicTranslator + implements EclipseLinkOrmXmlMapper +{ + private Translator[] children; + + public BasicMapTranslator(String domNameAndPath, EStructuralFeature aFeature) { + super(domNameAndPath, aFeature); + } + + @Override + public EObject createEMFObject(String nodeName, String readAheadName) { + return EclipseLinkOrmFactory.eINSTANCE.createXmlBasicMapImpl(); + } + + @Override + protected Translator[] getChildren() { + if (this.children == null) { + this.children = createChildren(); + } + return this.children; + } + + @Override + protected Translator[] createChildren() { + return new Translator[] { + createNameTranslator() + }; + } + + @Override + protected Translator createNameTranslator() { + return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkAttributesTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkAttributesTranslator.java index be5bd27d0a..2f61bd9b85 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkAttributesTranslator.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkAttributesTranslator.java @@ -10,8 +10,10 @@ *******************************************************************************/ package org.eclipse.jpt.eclipselink.core.internal.resource.orm.translators; +import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.jpt.core.internal.resource.orm.translators.AttributesTranslator; +import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory; import org.eclipse.wst.common.internal.emf.resource.Translator; public class EclipseLinkAttributesTranslator extends AttributesTranslator @@ -21,19 +23,26 @@ public class EclipseLinkAttributesTranslator extends AttributesTranslator super(domNameAndPath, aFeature); } - + @Override + public EObject createEMFObject(String nodeName, String readAheadName) { + return EclipseLinkOrmFactory.eINSTANCE.createAttributes(); + + } @Override protected Translator[] createChildren() { return new Translator[] { createIdTranslator(), createEmbeddedIdTranslator(), createBasicTranslator(), + createBasicCollectionTranslator(), + createBasicMapTranslator(), createVersionTranslator(), createManyToOneTranslator(), createOneToManyTranslator(), createOneToOneTranslator(), createManyToManyTranslator(), createEmbeddedTranslator(), + createTransformationTranslator(), createTransientTranslator() }; } @@ -84,4 +93,17 @@ public class EclipseLinkAttributesTranslator extends AttributesTranslator // protected Translator createTransientTranslator() { // return new TransientTranslator(TRANSIENT, ORM_PKG.getAttributes_Transients()); // } + + + protected Translator createBasicCollectionTranslator() { + return new BasicCollectionTranslator(BASIC_COLLECTION, ECLIPSELINK_ORM_PKG.getAttributes_BasicCollections()); + } + + protected Translator createBasicMapTranslator() { + return new BasicMapTranslator(BASIC_MAP, ECLIPSELINK_ORM_PKG.getAttributes_BasicMaps()); + } + + protected Translator createTransformationTranslator() { + return new TransformationTranslator(TRANSFORMATION, ECLIPSELINK_ORM_PKG.getAttributes_Transformations()); + } } diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOrmXmlMapper.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOrmXmlMapper.java index aed806ffc5..c80fdc1792 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOrmXmlMapper.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/EclipseLinkOrmXmlMapper.java @@ -17,6 +17,10 @@ public interface EclipseLinkOrmXmlMapper { EclipseLinkOrmPackage ECLIPSELINK_ORM_PKG = EclipseLinkOrmPackage.eINSTANCE; + String BASIC_COLLECTION = "basic-collection"; //$NON-NLS-1$ + + String BASIC_MAP = "basic-map"; //$NON-NLS-1$ + String CACHE = "cache"; //$NON-NLS-1$ String CACHE__EXPIRY = "expiry"; //$NON-NLS-1$ String CACHE__SIZE = "size"; //$NON-NLS-1$ @@ -67,6 +71,8 @@ public interface EclipseLinkOrmXmlMapper String STRUCT_CONVERTER__NAME = "name"; //$NON-NLS-1$ String STRUCT_CONVERTER__CONVERTER = "converter"; //$NON-NLS-1$ + String TRANSFORMATION = "transformation"; //$NON-NLS-1$ + String TYPE = "type"; //$NON-NLS-1$ String TYPE_CONVERTER = "type-converter"; //$NON-NLS-1$ diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/TransformationTranslator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/TransformationTranslator.java new file mode 100644 index 0000000000..b3a0623561 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/translators/TransformationTranslator.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.internal.resource.orm.translators; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.jpt.core.internal.resource.orm.translators.BasicTranslator; +import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory; +import org.eclipse.wst.common.internal.emf.resource.Translator; + +public class TransformationTranslator extends BasicTranslator + implements EclipseLinkOrmXmlMapper +{ + private Translator[] children; + + public TransformationTranslator(String domNameAndPath, EStructuralFeature aFeature) { + super(domNameAndPath, aFeature); + } + + @Override + public EObject createEMFObject(String nodeName, String readAheadName) { + return EclipseLinkOrmFactory.eINSTANCE.createXmlTransformationImpl(); + } + + @Override + protected Translator[] getChildren() { + if (this.children == null) { + this.children = createChildren(); + } + return this.children; + } + + @Override + protected Translator[] createChildren() { + return new Translator[] { + createNameTranslator() + }; + } + + @Override + protected Translator createNameTranslator() { + return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicCollectionAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicCollectionAnnotation.java new file mode 100644 index 0000000000..5fa7bc7e0d --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicCollectionAnnotation.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.resource.java; + +import org.eclipse.jpt.core.resource.java.JavaResourceNode; + +/** + * Java resource model interface that corresponds to the Eclipselink + * annotation org.eclipse.persistence.annotations.Transformation + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + * + * @version 2.1 + * @since 2.1 + */ +public interface BasicCollectionAnnotation extends JavaResourceNode +{ + String ANNOTATION_NAME = EclipseLinkJPA.BASIC_COLLECTION; +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicMapAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicMapAnnotation.java new file mode 100644 index 0000000000..795c7c19ba --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BasicMapAnnotation.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.resource.java; + +import org.eclipse.jpt.core.resource.java.JavaResourceNode; + +/** + * Java resource model interface that corresponds to the Eclipselink + * annotation org.eclipse.persistence.annotations.BasicMap + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + * + * @version 2.1 + * @since 2.1 + */ +public interface BasicMapAnnotation extends JavaResourceNode +{ + String ANNOTATION_NAME = EclipseLinkJPA.BASIC_MAP; +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkJPA.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkJPA.java index fe8eda3acc..99aa7f2d7f 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkJPA.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkJPA.java @@ -33,6 +33,10 @@ public interface EclipseLinkJPA { // ********** API ********** // JPA annotations + String BASIC_COLLECTION = PACKAGE_ + "BasicCollection"; + + String BASIC_MAP = PACKAGE_ + "BasicMap"; + String CACHE = PACKAGE_ + "Cache"; String CACHE__SHARED = "shared"; String CACHE__EXPIRY = "expiry"; diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/Attributes.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/Attributes.java new file mode 100644 index 0000000000..5497fe6f6c --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/Attributes.java @@ -0,0 +1,351 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.resource.orm; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.ListIterator; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping; +import org.eclipse.jpt.core.resource.orm.XmlBasic; +import org.eclipse.jpt.core.resource.orm.XmlEmbedded; +import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId; +import org.eclipse.jpt.core.resource.orm.XmlId; +import org.eclipse.jpt.core.resource.orm.XmlManyToMany; +import org.eclipse.jpt.core.resource.orm.XmlManyToOne; +import org.eclipse.jpt.core.resource.orm.XmlOneToMany; +import org.eclipse.jpt.core.resource.orm.XmlOneToOne; +import org.eclipse.jpt.core.resource.orm.XmlTransient; +import org.eclipse.jpt.core.resource.orm.XmlVersion; +import org.eclipse.jpt.utility.internal.CollectionTools; +import org.eclipse.jpt.utility.internal.iterators.CloneListIterator; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Attributes</b></em>'. + * <!-- end-user-doc --> + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.Attributes#getBasicCollections <em>Basic Collections</em>}</li> + * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.Attributes#getBasicMaps <em>Basic Maps</em>}</li> + * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.Attributes#getTransformations <em>Transformations</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes() + * @model kind="class" + * @generated + */ +public class Attributes extends org.eclipse.jpt.core.resource.orm.Attributes +{ + /** + * The cached value of the '{@link #getBasicCollections() <em>Basic Collections</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getBasicCollections() + * @generated + * @ordered + */ + protected EList<XmlBasicCollection> basicCollections; + + /** + * The cached value of the '{@link #getBasicMaps() <em>Basic Maps</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getBasicMaps() + * @generated + * @ordered + */ + protected EList<XmlBasicMap> basicMaps; + + /** + * The cached value of the '{@link #getTransformations() <em>Transformations</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getTransformations() + * @generated + * @ordered + */ + protected EList<XmlTransformation> transformations; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected Attributes() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EclipseLinkOrmPackage.Literals.ATTRIBUTES; + } + + /** + * Returns the value of the '<em><b>Basic Collections</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Basic Collections</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Basic Collections</em>' containment reference list. + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes_BasicCollections() + * @model containment="true" + * @generated + */ + public EList<XmlBasicCollection> getBasicCollections() + { + if (basicCollections == null) + { + basicCollections = new EObjectContainmentEList<XmlBasicCollection>(XmlBasicCollection.class, this, EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS); + } + return basicCollections; + } + + /** + * Returns the value of the '<em><b>Basic Maps</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Basic Maps</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Basic Maps</em>' containment reference list. + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes_BasicMaps() + * @model containment="true" + * @generated + */ + public EList<XmlBasicMap> getBasicMaps() + { + if (basicMaps == null) + { + basicMaps = new EObjectContainmentEList<XmlBasicMap>(XmlBasicMap.class, this, EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS); + } + return basicMaps; + } + + /** + * Returns the value of the '<em><b>Transformations</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Transformations</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Transformations</em>' containment reference list. + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes_Transformations() + * @model containment="true" + * @generated + */ + public EList<XmlTransformation> getTransformations() + { + if (transformations == null) + { + transformations = new EObjectContainmentEList<XmlTransformation>(XmlTransformation.class, this, EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS); + } + return transformations; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS: + return ((InternalEList<?>)getBasicCollections()).basicRemove(otherEnd, msgs); + case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS: + return ((InternalEList<?>)getBasicMaps()).basicRemove(otherEnd, msgs); + case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS: + return ((InternalEList<?>)getTransformations()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS: + return getBasicCollections(); + case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS: + return getBasicMaps(); + case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS: + return getTransformations(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS: + getBasicCollections().clear(); + getBasicCollections().addAll((Collection<? extends XmlBasicCollection>)newValue); + return; + case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS: + getBasicMaps().clear(); + getBasicMaps().addAll((Collection<? extends XmlBasicMap>)newValue); + return; + case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS: + getTransformations().clear(); + getTransformations().addAll((Collection<? extends XmlTransformation>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS: + getBasicCollections().clear(); + return; + case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS: + getBasicMaps().clear(); + return; + case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS: + getTransformations().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS: + return basicCollections != null && !basicCollections.isEmpty(); + case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS: + return basicMaps != null && !basicMaps.isEmpty(); + case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS: + return transformations != null && !transformations.isEmpty(); + } + return super.eIsSet(featureID); + } + + @Override + public List<XmlAttributeMapping> getAttributeMappings() { + List<XmlAttributeMapping> attributeMappings = new ArrayList<XmlAttributeMapping>(); + ListIterator<XmlId> ids = new CloneListIterator<XmlId>(this.getIds());//prevent ConcurrentModificiationException + for (XmlId mapping : CollectionTools.iterable(ids)) { + attributeMappings.add(mapping); + } + ListIterator<XmlEmbeddedId> embeddedIds = new CloneListIterator<XmlEmbeddedId>(this.getEmbeddedIds());//prevent ConcurrentModificiationException + for (XmlEmbeddedId mapping : CollectionTools.iterable(embeddedIds)) { + attributeMappings.add(mapping); + } + ListIterator<XmlBasic> basics = new CloneListIterator<XmlBasic>(this.getBasics());//prevent ConcurrentModificiationException + for (XmlBasic mapping : CollectionTools.iterable(basics)) { + attributeMappings.add(mapping); + } + ListIterator<XmlBasicCollection> basicCollections = new CloneListIterator<XmlBasicCollection>(this.getBasicCollections());//prevent ConcurrentModificiationException + for (XmlBasicCollection mapping : CollectionTools.iterable(basicCollections)) { + attributeMappings.add(mapping); + } + ListIterator<XmlBasicMap> basicMaps = new CloneListIterator<XmlBasicMap>(this.getBasicMaps());//prevent ConcurrentModificiationException + for (XmlBasicMap mapping : CollectionTools.iterable(basicMaps)) { + attributeMappings.add(mapping); + } + ListIterator<XmlVersion> versions = new CloneListIterator<XmlVersion>(this.getVersions());//prevent ConcurrentModificiationException + for (XmlVersion mapping : CollectionTools.iterable(versions)) { + attributeMappings.add(mapping); + } + ListIterator<XmlManyToOne> manyToOnes = new CloneListIterator<XmlManyToOne>(this.getManyToOnes());//prevent ConcurrentModificiationException + for (XmlManyToOne mapping : CollectionTools.iterable(manyToOnes)) { + attributeMappings.add(mapping); + } + ListIterator<XmlOneToMany> oneToManys = new CloneListIterator<XmlOneToMany>(this.getOneToManys());//prevent ConcurrentModificiationException + for (XmlOneToMany mapping : CollectionTools.iterable(oneToManys)) { + attributeMappings.add(mapping); + } + ListIterator<XmlOneToOne> oneToOnes = new CloneListIterator<XmlOneToOne>(this.getOneToOnes());//prevent ConcurrentModificiationException + for (XmlOneToOne mapping : CollectionTools.iterable(oneToOnes)) { + attributeMappings.add(mapping); + } + ListIterator<XmlManyToMany> manyToManys = new CloneListIterator<XmlManyToMany>(this.getManyToManys());//prevent ConcurrentModificiationException + for (XmlManyToMany mapping : CollectionTools.iterable(manyToManys)) { + attributeMappings.add(mapping); + } + ListIterator<XmlEmbedded> embeddeds = new CloneListIterator<XmlEmbedded>(this.getEmbeddeds());//prevent ConcurrentModificiationException + for (XmlEmbedded mapping : CollectionTools.iterable(embeddeds)) { + attributeMappings.add(mapping); + } + ListIterator<XmlTransformation> transformations = new CloneListIterator<XmlTransformation>(this.getTransformations());//prevent ConcurrentModificiationException + for (XmlTransformation mapping : CollectionTools.iterable(transformations)) { + attributeMappings.add(mapping); + } + ListIterator<XmlTransient> transients = new CloneListIterator<XmlTransient>(this.getTransients());//prevent ConcurrentModificiationException + for (XmlTransient mapping : CollectionTools.iterable(transients)) { + attributeMappings.add(mapping); + } + return attributeMappings; + } + + +} // Attributes diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java index d933b91805..12a0232351 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java @@ -30,7 +30,6 @@ import org.eclipse.emf.ecore.plugin.EcorePlugin; * @since 2.1 * * <!-- end-user-doc --> - * * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage * @generated */ @@ -108,6 +107,10 @@ public class EclipseLinkOrmFactory extends EFactoryImpl case EclipseLinkOrmPackage.XML_ONE_TO_MANY_IMPL: return (EObject)createXmlOneToManyImpl(); case EclipseLinkOrmPackage.XML_MANY_TO_ONE_IMPL: return (EObject)createXmlManyToOneImpl(); case EclipseLinkOrmPackage.XML_MANY_TO_MANY_IMPL: return (EObject)createXmlManyToManyImpl(); + case EclipseLinkOrmPackage.ATTRIBUTES: return (EObject)createAttributes(); + case EclipseLinkOrmPackage.XML_BASIC_COLLECTION_IMPL: return (EObject)createXmlBasicCollectionImpl(); + case EclipseLinkOrmPackage.XML_BASIC_MAP_IMPL: return (EObject)createXmlBasicMapImpl(); + case EclipseLinkOrmPackage.XML_TRANSFORMATION_IMPL: return (EObject)createXmlTransformationImpl(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -366,6 +369,50 @@ public class EclipseLinkOrmFactory extends EFactoryImpl * <!-- end-user-doc --> * @generated */ + public Attributes createAttributes() + { + Attributes attributes = new Attributes(); + return attributes; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public XmlBasicCollectionImpl createXmlBasicCollectionImpl() + { + XmlBasicCollectionImpl xmlBasicCollectionImpl = new XmlBasicCollectionImpl(); + return xmlBasicCollectionImpl; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public XmlBasicMapImpl createXmlBasicMapImpl() + { + XmlBasicMapImpl xmlBasicMapImpl = new XmlBasicMapImpl(); + return xmlBasicMapImpl; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public XmlTransformationImpl createXmlTransformationImpl() + { + XmlTransformationImpl xmlTransformationImpl = new XmlTransformationImpl(); + return xmlTransformationImpl; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public XmlChangeTrackingType createXmlChangeTrackingTypeFromString(EDataType eDataType, String initialValue) { XmlChangeTrackingType result = XmlChangeTrackingType.get(initialValue); diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java index 59b99cc126..309db2551e 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java @@ -40,7 +40,6 @@ import org.eclipse.jpt.core.resource.orm.OrmPackage; * @since 2.1 * * <!-- end-user-doc --> - * * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory * @model kind="package" * @generated @@ -3741,6 +3740,310 @@ public class EclipseLinkOrmPackage extends EPackageImpl public static final int XML_MANY_TO_MANY_IMPL_FEATURE_COUNT = OrmPackage.XML_MANY_TO_MANY_IMPL_FEATURE_COUNT + 1; /** + * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.Attributes + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes() + * @generated + */ + public static final int ATTRIBUTES = 43; + + /** + * The feature id for the '<em><b>Ids</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES__IDS = OrmPackage.ATTRIBUTES__IDS; + + /** + * The feature id for the '<em><b>Embedded Ids</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES__EMBEDDED_IDS = OrmPackage.ATTRIBUTES__EMBEDDED_IDS; + + /** + * The feature id for the '<em><b>Basics</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES__BASICS = OrmPackage.ATTRIBUTES__BASICS; + + /** + * The feature id for the '<em><b>Versions</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES__VERSIONS = OrmPackage.ATTRIBUTES__VERSIONS; + + /** + * The feature id for the '<em><b>Many To Ones</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES__MANY_TO_ONES = OrmPackage.ATTRIBUTES__MANY_TO_ONES; + + /** + * The feature id for the '<em><b>One To Manys</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES__ONE_TO_MANYS = OrmPackage.ATTRIBUTES__ONE_TO_MANYS; + + /** + * The feature id for the '<em><b>One To Ones</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES__ONE_TO_ONES = OrmPackage.ATTRIBUTES__ONE_TO_ONES; + + /** + * The feature id for the '<em><b>Many To Manys</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES__MANY_TO_MANYS = OrmPackage.ATTRIBUTES__MANY_TO_MANYS; + + /** + * The feature id for the '<em><b>Embeddeds</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES__EMBEDDEDS = OrmPackage.ATTRIBUTES__EMBEDDEDS; + + /** + * The feature id for the '<em><b>Transients</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES__TRANSIENTS = OrmPackage.ATTRIBUTES__TRANSIENTS; + + /** + * The feature id for the '<em><b>Basic Collections</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES__BASIC_COLLECTIONS = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Basic Maps</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES__BASIC_MAPS = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Transformations</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES__TRANSFORMATIONS = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 2; + + /** + * The number of structural features of the '<em>Attributes</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ATTRIBUTES_FEATURE_COUNT = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection <em>Xml Basic Collection</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection() + * @generated + */ + public static final int XML_BASIC_COLLECTION = 44; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_BASIC_COLLECTION__NAME = OrmPackage.XML_ATTRIBUTE_MAPPING__NAME; + + /** + * The number of structural features of the '<em>Xml Basic Collection</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_BASIC_COLLECTION_FEATURE_COUNT = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollectionImpl <em>Xml Basic Collection Impl</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollectionImpl + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollectionImpl() + * @generated + */ + public static final int XML_BASIC_COLLECTION_IMPL = 45; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_BASIC_COLLECTION_IMPL__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME; + + /** + * The number of structural features of the '<em>Xml Basic Collection Impl</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_BASIC_COLLECTION_IMPL_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap <em>Xml Basic Map</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap() + * @generated + */ + public static final int XML_BASIC_MAP = 46; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_BASIC_MAP__NAME = OrmPackage.XML_ATTRIBUTE_MAPPING__NAME; + + /** + * The number of structural features of the '<em>Xml Basic Map</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_BASIC_MAP_FEATURE_COUNT = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMapImpl <em>Xml Basic Map Impl</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMapImpl + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMapImpl() + * @generated + */ + public static final int XML_BASIC_MAP_IMPL = 47; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_BASIC_MAP_IMPL__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME; + + /** + * The number of structural features of the '<em>Xml Basic Map Impl</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_BASIC_MAP_IMPL_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation <em>Xml Transformation</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformation() + * @generated + */ + public static final int XML_TRANSFORMATION = 48; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TRANSFORMATION__NAME = OrmPackage.XML_ATTRIBUTE_MAPPING__NAME; + + /** + * The number of structural features of the '<em>Xml Transformation</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TRANSFORMATION_FEATURE_COUNT = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformationImpl <em>Xml Transformation Impl</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformationImpl + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformationImpl() + * @generated + */ + public static final int XML_TRANSFORMATION_IMPL = 49; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TRANSFORMATION_IMPL__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME; + + /** + * The number of structural features of the '<em>Xml Transformation Impl</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TRANSFORMATION_IMPL_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; + + /** * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingType <em>Xml Change Tracking Type</em>}' enum. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -3748,7 +4051,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingType() * @generated */ - public static final int XML_CHANGE_TRACKING_TYPE = 43; + public static final int XML_CHANGE_TRACKING_TYPE = 50; /** * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.CacheType <em>Cache Type</em>}' enum. @@ -3758,7 +4061,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheType() * @generated */ - public static final int CACHE_TYPE = 44; + public static final int CACHE_TYPE = 51; /** * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.CacheCoordinationType <em>Cache Coordination Type</em>}' enum. @@ -3768,7 +4071,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheCoordinationType() * @generated */ - public static final int CACHE_COORDINATION_TYPE = 45; + public static final int CACHE_COORDINATION_TYPE = 52; /** * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType <em>Xml Join Fetch Type</em>}' enum. @@ -3778,7 +4081,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetchType() * @generated */ - public static final int XML_JOIN_FETCH_TYPE = 47; + public static final int XML_JOIN_FETCH_TYPE = 54; /** * <!-- begin-user-doc --> @@ -3795,7 +4098,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getExistenceType() * @generated */ - public static final int EXISTENCE_TYPE = 46; + public static final int EXISTENCE_TYPE = 53; /** * <!-- begin-user-doc --> @@ -4019,6 +4322,55 @@ public class EclipseLinkOrmPackage extends EPackageImpl * <!-- end-user-doc --> * @generated */ + private EClass attributesEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass xmlBasicCollectionEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass xmlBasicCollectionImplEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass xmlBasicMapEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass xmlBasicMapImplEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass xmlTransformationEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass xmlTransformationImplEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ private EEnum xmlChangeTrackingTypeEEnum = null; /** @@ -5046,6 +5398,149 @@ public class EclipseLinkOrmPackage extends EPackageImpl /** + * Returns the meta object for class '{@link org.eclipse.jpt.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Attributes</em>'. + * @see org.eclipse.jpt.eclipselink.core.resource.orm.Attributes + * @generated + */ + public EClass getAttributes() + { + return attributesEClass; + } + + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.eclipselink.core.resource.orm.Attributes#getBasicCollections <em>Basic Collections</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Basic Collections</em>'. + * @see org.eclipse.jpt.eclipselink.core.resource.orm.Attributes#getBasicCollections() + * @see #getAttributes() + * @generated + */ + public EReference getAttributes_BasicCollections() + { + return (EReference)attributesEClass.getEStructuralFeatures().get(0); + } + + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.eclipselink.core.resource.orm.Attributes#getBasicMaps <em>Basic Maps</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Basic Maps</em>'. + * @see org.eclipse.jpt.eclipselink.core.resource.orm.Attributes#getBasicMaps() + * @see #getAttributes() + * @generated + */ + public EReference getAttributes_BasicMaps() + { + return (EReference)attributesEClass.getEStructuralFeatures().get(1); + } + + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.eclipselink.core.resource.orm.Attributes#getTransformations <em>Transformations</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Transformations</em>'. + * @see org.eclipse.jpt.eclipselink.core.resource.orm.Attributes#getTransformations() + * @see #getAttributes() + * @generated + */ + public EReference getAttributes_Transformations() + { + return (EReference)attributesEClass.getEStructuralFeatures().get(2); + } + + + /** + * Returns the meta object for class '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection <em>Xml Basic Collection</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Xml Basic Collection</em>'. + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection + * @generated + */ + public EClass getXmlBasicCollection() + { + return xmlBasicCollectionEClass; + } + + + /** + * Returns the meta object for class '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollectionImpl <em>Xml Basic Collection Impl</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Xml Basic Collection Impl</em>'. + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollectionImpl + * @generated + */ + public EClass getXmlBasicCollectionImpl() + { + return xmlBasicCollectionImplEClass; + } + + + /** + * Returns the meta object for class '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap <em>Xml Basic Map</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Xml Basic Map</em>'. + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap + * @generated + */ + public EClass getXmlBasicMap() + { + return xmlBasicMapEClass; + } + + + /** + * Returns the meta object for class '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMapImpl <em>Xml Basic Map Impl</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Xml Basic Map Impl</em>'. + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMapImpl + * @generated + */ + public EClass getXmlBasicMapImpl() + { + return xmlBasicMapImplEClass; + } + + + /** + * Returns the meta object for class '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation <em>Xml Transformation</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Xml Transformation</em>'. + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation + * @generated + */ + public EClass getXmlTransformation() + { + return xmlTransformationEClass; + } + + + /** + * Returns the meta object for class '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformationImpl <em>Xml Transformation Impl</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Xml Transformation Impl</em>'. + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformationImpl + * @generated + */ + public EClass getXmlTransformationImpl() + { + return xmlTransformationImplEClass; + } + + + /** * Returns the meta object for enum '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingType <em>Xml Change Tracking Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -5636,6 +6131,23 @@ public class EclipseLinkOrmPackage extends EPackageImpl xmlManyToManyImplEClass = createEClass(XML_MANY_TO_MANY_IMPL); + attributesEClass = createEClass(ATTRIBUTES); + createEReference(attributesEClass, ATTRIBUTES__BASIC_COLLECTIONS); + createEReference(attributesEClass, ATTRIBUTES__BASIC_MAPS); + createEReference(attributesEClass, ATTRIBUTES__TRANSFORMATIONS); + + xmlBasicCollectionEClass = createEClass(XML_BASIC_COLLECTION); + + xmlBasicCollectionImplEClass = createEClass(XML_BASIC_COLLECTION_IMPL); + + xmlBasicMapEClass = createEClass(XML_BASIC_MAP); + + xmlBasicMapImplEClass = createEClass(XML_BASIC_MAP_IMPL); + + xmlTransformationEClass = createEClass(XML_TRANSFORMATION); + + xmlTransformationImplEClass = createEClass(XML_TRANSFORMATION_IMPL); + // Create enums xmlChangeTrackingTypeEEnum = createEEnum(XML_CHANGE_TRACKING_TYPE); cacheTypeEEnum = createEEnum(CACHE_TYPE); @@ -5739,6 +6251,16 @@ public class EclipseLinkOrmPackage extends EPackageImpl xmlManyToManyEClass.getESuperTypes().add(this.getXmlJoinFetch()); xmlManyToManyImplEClass.getESuperTypes().add(theOrmPackage.getXmlManyToManyImpl()); xmlManyToManyImplEClass.getESuperTypes().add(this.getXmlManyToMany()); + attributesEClass.getESuperTypes().add(theOrmPackage.getAttributes()); + xmlBasicCollectionEClass.getESuperTypes().add(theOrmPackage.getXmlAttributeMapping()); + xmlBasicCollectionImplEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping()); + xmlBasicCollectionImplEClass.getESuperTypes().add(this.getXmlBasicCollection()); + xmlBasicMapEClass.getESuperTypes().add(theOrmPackage.getXmlAttributeMapping()); + xmlBasicMapImplEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping()); + xmlBasicMapImplEClass.getESuperTypes().add(this.getXmlBasicMap()); + xmlTransformationEClass.getESuperTypes().add(theOrmPackage.getXmlAttributeMapping()); + xmlTransformationImplEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping()); + xmlTransformationImplEClass.getESuperTypes().add(this.getXmlTransformation()); // Initialize classes and features; add operations and parameters initEClass(xmlNamedConverterEClass, XmlNamedConverter.class, "XmlNamedConverter", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -5870,6 +6392,23 @@ public class EclipseLinkOrmPackage extends EPackageImpl initEClass(xmlManyToManyImplEClass, XmlManyToManyImpl.class, "XmlManyToManyImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(attributesEClass, Attributes.class, "Attributes", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getAttributes_BasicCollections(), this.getXmlBasicCollection(), null, "basicCollections", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getAttributes_BasicMaps(), this.getXmlBasicMap(), null, "basicMaps", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getAttributes_Transformations(), this.getXmlTransformation(), null, "transformations", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(xmlBasicCollectionEClass, XmlBasicCollection.class, "XmlBasicCollection", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(xmlBasicCollectionImplEClass, XmlBasicCollectionImpl.class, "XmlBasicCollectionImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(xmlBasicMapEClass, XmlBasicMap.class, "XmlBasicMap", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(xmlBasicMapImplEClass, XmlBasicMapImpl.class, "XmlBasicMapImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(xmlTransformationEClass, XmlTransformation.class, "XmlTransformation", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(xmlTransformationImplEClass, XmlTransformationImpl.class, "XmlTransformationImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + // Initialize enums and add enum literals initEEnum(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.class, "XmlChangeTrackingType"); addEEnumLiteral(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.ATTRIBUTE); @@ -6473,6 +7012,100 @@ public class EclipseLinkOrmPackage extends EPackageImpl public static final EClass XML_MANY_TO_MANY_IMPL = eINSTANCE.getXmlManyToManyImpl(); /** + * The meta object literal for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.Attributes + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes() + * @generated + */ + public static final EClass ATTRIBUTES = eINSTANCE.getAttributes(); + + /** + * The meta object literal for the '<em><b>Basic Collections</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EReference ATTRIBUTES__BASIC_COLLECTIONS = eINSTANCE.getAttributes_BasicCollections(); + + /** + * The meta object literal for the '<em><b>Basic Maps</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EReference ATTRIBUTES__BASIC_MAPS = eINSTANCE.getAttributes_BasicMaps(); + + /** + * The meta object literal for the '<em><b>Transformations</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EReference ATTRIBUTES__TRANSFORMATIONS = eINSTANCE.getAttributes_Transformations(); + + /** + * The meta object literal for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection <em>Xml Basic Collection</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection() + * @generated + */ + public static final EClass XML_BASIC_COLLECTION = eINSTANCE.getXmlBasicCollection(); + + /** + * The meta object literal for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollectionImpl <em>Xml Basic Collection Impl</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollectionImpl + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollectionImpl() + * @generated + */ + public static final EClass XML_BASIC_COLLECTION_IMPL = eINSTANCE.getXmlBasicCollectionImpl(); + + /** + * The meta object literal for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap <em>Xml Basic Map</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap() + * @generated + */ + public static final EClass XML_BASIC_MAP = eINSTANCE.getXmlBasicMap(); + + /** + * The meta object literal for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMapImpl <em>Xml Basic Map Impl</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMapImpl + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMapImpl() + * @generated + */ + public static final EClass XML_BASIC_MAP_IMPL = eINSTANCE.getXmlBasicMapImpl(); + + /** + * The meta object literal for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation <em>Xml Transformation</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformation() + * @generated + */ + public static final EClass XML_TRANSFORMATION = eINSTANCE.getXmlTransformation(); + + /** + * The meta object literal for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformationImpl <em>Xml Transformation Impl</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformationImpl + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformationImpl() + * @generated + */ + public static final EClass XML_TRANSFORMATION_IMPL = eINSTANCE.getXmlTransformationImpl(); + + /** * The meta object literal for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingType <em>Xml Change Tracking Type</em>}' enum. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollection.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollection.java new file mode 100644 index 0000000000..d35828bc92 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollection.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.resource.orm; + +import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Xml Basic Collection</b></em>'. + * <!-- end-user-doc --> + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. * + * + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection() + * @model kind="class" interface="true" abstract="true" + * @generated + */ +public interface XmlBasicCollection extends XmlAttributeMapping +{ +} // XmlBasicCollection diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollectionImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollectionImpl.java new file mode 100644 index 0000000000..62720305d9 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollectionImpl.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.resource.orm; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Xml Basic Collection Impl</b></em>'. + * <!-- end-user-doc --> + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. * + * + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollectionImpl() + * @model kind="class" + * @generated + */ +public class XmlBasicCollectionImpl extends AbstractXmlAttributeMapping implements XmlBasicCollection +{ + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected XmlBasicCollectionImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EclipseLinkOrmPackage.Literals.XML_BASIC_COLLECTION_IMPL; + } + + public String getMappingKey() { + return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY; + } +} // XmlBasicCollectionImpl diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMap.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMap.java new file mode 100644 index 0000000000..4777c01676 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMap.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.resource.orm; + +import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Xml Basic Map</b></em>'. + * <!-- end-user-doc --> + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. * + * + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap() + * @model kind="class" interface="true" abstract="true" + * @generated + */ +public interface XmlBasicMap extends XmlAttributeMapping +{ +} // XmlBasicMap diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMapImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMapImpl.java new file mode 100644 index 0000000000..3cbdcb520b --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMapImpl.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.resource.orm; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Xml Basic Map Impl</b></em>'. + * <!-- end-user-doc --> + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. * + * + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMapImpl() + * @model kind="class" + * @generated + */ +public class XmlBasicMapImpl extends AbstractXmlAttributeMapping implements XmlBasicMap +{ + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected XmlBasicMapImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EclipseLinkOrmPackage.Literals.XML_BASIC_MAP_IMPL; + } + + public String getMappingKey() { + return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY; + } +} // XmlBasicMapImpl diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformation.java new file mode 100644 index 0000000000..de24874091 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformation.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.resource.orm; + +import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Xml Transformation</b></em>'. + * <!-- end-user-doc --> + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. * + * + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformation() + * @model kind="class" interface="true" abstract="true" + * @generated + */ +public interface XmlTransformation extends XmlAttributeMapping +{ +} // XmlTransformation diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformationImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformationImpl.java new file mode 100644 index 0000000000..5145ba6396 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformationImpl.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.core.resource.orm; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping; +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Xml Transformation Impl</b></em>'. + * <!-- end-user-doc --> + * + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. * + * + * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformationImpl() + * @model kind="class" + * @generated + */ +public class XmlTransformationImpl extends AbstractXmlAttributeMapping implements XmlTransformation +{ + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected XmlTransformationImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return EclipseLinkOrmPackage.Literals.XML_TRANSFORMATION_IMPL; + } + + public String getMappingKey() { + return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY; + } +} // XmlTransformationImpl diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui_mappings.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui_mappings.properties index 1a2ee6aeb4..d0ed6657e1 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui_mappings.properties +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui_mappings.properties @@ -8,6 +8,15 @@ # Oracle - initial API and implementation ################################################################################ +BasicCollectionMappingUiProvider_label = Basic Collection +BasicCollectionMappingUiProvider_linkLabel = basic collection + +BasicMapMappingUiProvider_label = Basic Map +BasicMapMappingUiProvider_linkLabel = basic map + +TransformationMappingUiProvider_label = Transformation +TransformationMappingUiProvider_linkLabel = transformation + CacheTypeComposite_label = Type: CacheTypeComposite_full = Full CacheTypeComposite_weak = Weak diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkJpaUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkJpaUiFactory.java index 34f0351e79..91cc22774e 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkJpaUiFactory.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkJpaUiFactory.java @@ -25,6 +25,9 @@ import org.eclipse.jpt.core.context.orm.OrmEmbeddable; import org.eclipse.jpt.core.context.orm.OrmEntity; import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass; import org.eclipse.jpt.core.context.persistence.PersistenceUnit; +import org.eclipse.jpt.eclipselink.core.context.BasicCollectionMapping; +import org.eclipse.jpt.eclipselink.core.context.BasicMapMapping; +import org.eclipse.jpt.eclipselink.core.context.TransformationMapping; import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit; import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.Caching; import org.eclipse.jpt.eclipselink.core.internal.context.persistence.connection.Connection; @@ -35,10 +38,13 @@ import org.eclipse.jpt.eclipselink.core.internal.context.persistence.schema.gene import org.eclipse.jpt.eclipselink.ui.internal.java.details.EclipseLinkJavaEmbeddableComposite; import org.eclipse.jpt.eclipselink.ui.internal.java.details.EclipseLinkJavaEntityComposite; import org.eclipse.jpt.eclipselink.ui.internal.java.details.EclipseLinkJavaMappedSuperclassComposite; +import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.BasicCollectionMappingComposite; +import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.BasicMapMappingComposite; import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.EclipseLinkBasicMappingComposite; import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.EclipseLinkIdMappingComposite; import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.EclipseLinkManyToManyMappingComposite; import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.EclipseLinkManyToOneMappingComposite; +import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.TransformationMappingComposite; import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.EclipseLinkVersionMappingComposite; import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.EclipselinkOneToManyMappingComposite; import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.EclipselinkOneToOneMappingComposite; @@ -277,7 +283,28 @@ public class EclipseLinkJpaUiFactory extends BaseJpaUiFactory return new EclipseLinkManyToOneMappingComposite(subjectHolder, parent, widgetFactory); } + public JpaComposite createBasicCollectionMappingComposite( + PropertyValueModel<BasicCollectionMapping> subjectHolder, + Composite parent, + WidgetFactory widgetFactory) { + + return new BasicCollectionMappingComposite(subjectHolder, parent, widgetFactory); + } + public JpaComposite createBasicMapMappingComposite( + PropertyValueModel<BasicMapMapping> subjectHolder, + Composite parent, + WidgetFactory widgetFactory) { + + return new BasicMapMappingComposite(subjectHolder, parent, widgetFactory); + } + public JpaComposite createTransformationMappingComposite( + PropertyValueModel<TransformationMapping> subjectHolder, + Composite parent, + WidgetFactory widgetFactory) { + + return new TransformationMappingComposite(subjectHolder, parent, widgetFactory); + } // **************** java-specific mapping UI ******************************* @Override diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/EclipseLinkUiMappingsMessages.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/EclipseLinkUiMappingsMessages.java index 3df672698d..dbddeda6ab 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/EclipseLinkUiMappingsMessages.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/EclipseLinkUiMappingsMessages.java @@ -20,6 +20,15 @@ import org.eclipse.osgi.util.NLS; @SuppressWarnings("nls") public class EclipseLinkUiMappingsMessages extends NLS { + public static String BasicCollectionMappingUiProvider_label; + public static String BasicCollectionMappingUiProvider_linkLabel; + + public static String BasicMapMappingUiProvider_label; + public static String BasicMapMappingUiProvider_linkLabel; + + public static String TransformationMappingUiProvider_label; + public static String TransformationMappingUiProvider_linkLabel; + public static String CacheTypeComposite_label; public static String CacheTypeComposite_full; public static String CacheTypeComposite_weak; diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/BasicCollectionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/BasicCollectionMappingComposite.java new file mode 100644 index 0000000000..32e48c6646 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/BasicCollectionMappingComposite.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.ui.internal.mappings.details; + +import org.eclipse.jpt.eclipselink.core.context.BasicCollectionMapping; +import org.eclipse.jpt.ui.WidgetFactory; +import org.eclipse.jpt.ui.details.JpaComposite; +import org.eclipse.jpt.ui.internal.widgets.FormPane; +import org.eclipse.jpt.utility.model.value.PropertyValueModel; +import org.eclipse.swt.widgets.Composite; + +/** + * + * @version 2.1 + * @since 2.1 + */ +public class BasicCollectionMappingComposite extends FormPane<BasicCollectionMapping> + implements JpaComposite +{ + /** + * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>. + * + * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code> + * @param parent The parent container + * @param widgetFactory The factory used to create various common widgets + */ + public BasicCollectionMappingComposite(PropertyValueModel<? extends BasicCollectionMapping> subjectHolder, + Composite parent, + WidgetFactory widgetFactory) { + + super(subjectHolder, parent, widgetFactory); + } + + @Override + protected void initializeLayout(Composite container) { + + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/BasicCollectionMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/BasicCollectionMappingUiProvider.java new file mode 100644 index 0000000000..96b5ef363e --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/BasicCollectionMappingUiProvider.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.ui.internal.mappings.details; + +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.context.BasicCollectionMapping; +import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkJpaUiFactory; +import org.eclipse.jpt.eclipselink.ui.internal.mappings.EclipseLinkUiMappingsMessages; +import org.eclipse.jpt.ui.JpaUiFactory; +import org.eclipse.jpt.ui.JptUiPlugin; +import org.eclipse.jpt.ui.WidgetFactory; +import org.eclipse.jpt.ui.details.AttributeMappingUiProvider; +import org.eclipse.jpt.ui.details.JpaComposite; +import org.eclipse.jpt.ui.internal.JptUiIcons; +import org.eclipse.jpt.utility.model.value.PropertyValueModel; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Composite; + +public class BasicCollectionMappingUiProvider + implements AttributeMappingUiProvider<BasicCollectionMapping> +{ + // singleton + private static final BasicCollectionMappingUiProvider INSTANCE = new BasicCollectionMappingUiProvider(); + + /** + * Ensure single instance. + */ + private BasicCollectionMappingUiProvider() { + super(); + } + + /** + * Return the singleton. + */ + public static AttributeMappingUiProvider<BasicCollectionMapping> instance() { + return INSTANCE; + } + + public JpaComposite buildAttributeMappingComposite( + JpaUiFactory factory, + PropertyValueModel<BasicCollectionMapping> subjectHolder, + Composite parent, + WidgetFactory widgetFactory) { + + return ((EclipseLinkJpaUiFactory) factory).createBasicCollectionMappingComposite(subjectHolder, parent, widgetFactory); + } + + public Image getImage() { + return JptUiPlugin.getImage(JptUiIcons.JPA_CONTENT); + } + + public String getLabel() { + return EclipseLinkUiMappingsMessages.BasicCollectionMappingUiProvider_label; + } + + public String getLinkLabel() { + return EclipseLinkUiMappingsMessages.BasicCollectionMappingUiProvider_linkLabel; + } + + public String getMappingKey() { + return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY; + } +}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/BasicMapMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/BasicMapMappingComposite.java new file mode 100644 index 0000000000..0003404b33 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/BasicMapMappingComposite.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.ui.internal.mappings.details; + +import org.eclipse.jpt.eclipselink.core.context.BasicMapMapping; +import org.eclipse.jpt.ui.WidgetFactory; +import org.eclipse.jpt.ui.details.JpaComposite; +import org.eclipse.jpt.ui.internal.widgets.FormPane; +import org.eclipse.jpt.utility.model.value.PropertyValueModel; +import org.eclipse.swt.widgets.Composite; + +/** + * + * @version 2.1 + * @since 2.1 + */ +public class BasicMapMappingComposite extends FormPane<BasicMapMapping> + implements JpaComposite +{ + /** + * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>. + * + * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code> + * @param parent The parent container + * @param widgetFactory The factory used to create various common widgets + */ + public BasicMapMappingComposite(PropertyValueModel<? extends BasicMapMapping> subjectHolder, + Composite parent, + WidgetFactory widgetFactory) { + + super(subjectHolder, parent, widgetFactory); + } + + @Override + protected void initializeLayout(Composite container) { + + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/BasicMapMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/BasicMapMappingUiProvider.java new file mode 100644 index 0000000000..f979179401 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/BasicMapMappingUiProvider.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.ui.internal.mappings.details; + +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.context.BasicMapMapping; +import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkJpaUiFactory; +import org.eclipse.jpt.eclipselink.ui.internal.mappings.EclipseLinkUiMappingsMessages; +import org.eclipse.jpt.ui.JpaUiFactory; +import org.eclipse.jpt.ui.JptUiPlugin; +import org.eclipse.jpt.ui.WidgetFactory; +import org.eclipse.jpt.ui.details.AttributeMappingUiProvider; +import org.eclipse.jpt.ui.details.JpaComposite; +import org.eclipse.jpt.ui.internal.JptUiIcons; +import org.eclipse.jpt.utility.model.value.PropertyValueModel; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Composite; + +public class BasicMapMappingUiProvider + implements AttributeMappingUiProvider<BasicMapMapping> +{ + // singleton + private static final BasicMapMappingUiProvider INSTANCE = new BasicMapMappingUiProvider(); + + /** + * Ensure single instance. + */ + private BasicMapMappingUiProvider() { + super(); + } + + /** + * Return the singleton. + */ + public static AttributeMappingUiProvider<BasicMapMapping> instance() { + return INSTANCE; + } + + public JpaComposite buildAttributeMappingComposite( + JpaUiFactory factory, + PropertyValueModel<BasicMapMapping> subjectHolder, + Composite parent, + WidgetFactory widgetFactory) { + + return ((EclipseLinkJpaUiFactory) factory).createBasicMapMappingComposite(subjectHolder, parent, widgetFactory); + } + + public Image getImage() { + return JptUiPlugin.getImage(JptUiIcons.JPA_CONTENT); + } + + public String getLabel() { + return EclipseLinkUiMappingsMessages.BasicMapMappingUiProvider_label; + } + + public String getLinkLabel() { + return EclipseLinkUiMappingsMessages.BasicMapMappingUiProvider_linkLabel; + } + + public String getMappingKey() { + return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY; + } +}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/TransformationMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/TransformationMappingComposite.java new file mode 100644 index 0000000000..2d70b233e3 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/TransformationMappingComposite.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.ui.internal.mappings.details; + +import org.eclipse.jpt.eclipselink.core.context.TransformationMapping; +import org.eclipse.jpt.ui.WidgetFactory; +import org.eclipse.jpt.ui.details.JpaComposite; +import org.eclipse.jpt.ui.internal.widgets.FormPane; +import org.eclipse.jpt.utility.model.value.PropertyValueModel; +import org.eclipse.swt.widgets.Composite; + +/** + * + * @version 2.1 + * @since 2.1 + */ +public class TransformationMappingComposite extends FormPane<TransformationMapping> + implements JpaComposite +{ + /** + * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>. + * + * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code> + * @param parent The parent container + * @param widgetFactory The factory used to create various common widgets + */ + public TransformationMappingComposite(PropertyValueModel<? extends TransformationMapping> subjectHolder, + Composite parent, + WidgetFactory widgetFactory) { + + super(subjectHolder, parent, widgetFactory); + } + + @Override + protected void initializeLayout(Composite container) { + + } +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/TransformationMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/TransformationMappingUiProvider.java new file mode 100644 index 0000000000..9474934983 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/mappings/details/TransformationMappingUiProvider.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2008 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.eclipselink.ui.internal.mappings.details; + +import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.eclipselink.core.context.TransformationMapping; +import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkJpaUiFactory; +import org.eclipse.jpt.eclipselink.ui.internal.mappings.EclipseLinkUiMappingsMessages; +import org.eclipse.jpt.ui.JpaUiFactory; +import org.eclipse.jpt.ui.JptUiPlugin; +import org.eclipse.jpt.ui.WidgetFactory; +import org.eclipse.jpt.ui.details.AttributeMappingUiProvider; +import org.eclipse.jpt.ui.details.JpaComposite; +import org.eclipse.jpt.ui.internal.JptUiIcons; +import org.eclipse.jpt.utility.model.value.PropertyValueModel; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Composite; + +public class TransformationMappingUiProvider + implements AttributeMappingUiProvider<TransformationMapping> +{ + // singleton + private static final TransformationMappingUiProvider INSTANCE = new TransformationMappingUiProvider(); + + /** + * Ensure single instance. + */ + private TransformationMappingUiProvider() { + super(); + } + + /** + * Return the singleton. + */ + public static AttributeMappingUiProvider<TransformationMapping> instance() { + return INSTANCE; + } + + public JpaComposite buildAttributeMappingComposite( + JpaUiFactory factory, + PropertyValueModel<TransformationMapping> subjectHolder, + Composite parent, + WidgetFactory widgetFactory) { + + return ((EclipseLinkJpaUiFactory) factory).createTransformationMappingComposite(subjectHolder, parent, widgetFactory); + } + + public Image getImage() { + return JptUiPlugin.getImage(JptUiIcons.JPA_CONTENT); + } + + public String getLabel() { + return EclipseLinkUiMappingsMessages.TransformationMappingUiProvider_label; + } + + public String getLinkLabel() { + return EclipseLinkUiMappingsMessages.TransformationMappingUiProvider_linkLabel; + } + + public String getMappingKey() { + return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY; + } +}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUI.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUI.java index e16dd1a540..f316ee71b8 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUI.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUI.java @@ -22,6 +22,9 @@ import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkJpaUiFactory; import org.eclipse.jpt.eclipselink.ui.internal.ddlgen.EclipseLinkDDLGeneratorUi; import org.eclipse.jpt.eclipselink.ui.internal.java.details.DefaultOneToManyMappingUiProvider; import org.eclipse.jpt.eclipselink.ui.internal.java.details.DefaultOneToOneMappingUiProvider; +import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.BasicCollectionMappingUiProvider; +import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.BasicMapMappingUiProvider; +import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.TransformationMappingUiProvider; import org.eclipse.jpt.eclipselink.ui.internal.orm.details.EclipseLinkOrmBasicMappingUiProvider; import org.eclipse.jpt.eclipselink.ui.internal.orm.details.EclipseLinkOrmIdMappingUiProvider; import org.eclipse.jpt.eclipselink.ui.internal.orm.details.EclipseLinkOrmVersionMappingUiProvider; @@ -99,6 +102,9 @@ public class EclipseLinkJpaPlatformUI extends BaseJpaPlatformUi protected void addJavaAttributeMappingUiProvidersTo( List<AttributeMappingUiProvider<? extends AttributeMapping>> providers) { super.addJavaAttributeMappingUiProvidersTo(providers); + providers.add(BasicCollectionMappingUiProvider.instance()); + providers.add(BasicMapMappingUiProvider.instance()); + providers.add(TransformationMappingUiProvider.instance()); } @Override @@ -118,6 +124,8 @@ public class EclipseLinkJpaPlatformUI extends BaseJpaPlatformUi @Override protected void addOrmAttributeMappingUiProvidersTo(List<AttributeMappingUiProvider<? extends AttributeMapping>> providers) { providers.add(EclipseLinkOrmBasicMappingUiProvider.instance()); + providers.add(BasicCollectionMappingUiProvider.instance()); + providers.add(BasicMapMappingUiProvider.instance()); providers.add(EmbeddedMappingUiProvider.instance()); providers.add(EmbeddedIdMappingUiProvider.instance()); providers.add(EclipseLinkOrmIdMappingUiProvider.instance()); @@ -125,6 +133,7 @@ public class EclipseLinkJpaPlatformUI extends BaseJpaPlatformUi providers.add(ManyToOneMappingUiProvider.instance()); providers.add(OneToManyMappingUiProvider.instance()); providers.add(OneToOneMappingUiProvider.instance()); + providers.add(TransformationMappingUiProvider.instance()); providers.add(TransientMappingUiProvider.instance()); providers.add(EclipseLinkOrmVersionMappingUiProvider.instance()); } diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaMappingImageHelper.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaMappingImageHelper.java index 4ad40adb32..5a2e9caaaf 100644 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaMappingImageHelper.java +++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaMappingImageHelper.java @@ -66,6 +66,7 @@ public class JpaMappingImageHelper else if (MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) { return JptUiPlugin.getImage(JptUiIcons.TRANSIENT); } - return null; + //return the JPA_CONTENT icon instead of null, might as well have an icon if one is not defined + return JptUiPlugin.getImage(JptUiIcons.JPA_CONTENT); } } diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java index b639d38531..74d189088f 100644 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java +++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java @@ -20,19 +20,11 @@ import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.ui.JpaPlatformUi; import org.eclipse.jpt.ui.JptUiPlugin; import org.eclipse.jpt.ui.details.AttributeMappingUiProvider; import org.eclipse.jpt.ui.internal.JptUiMessages; -import org.eclipse.jpt.ui.internal.details.BasicMappingUiProvider; -import org.eclipse.jpt.ui.internal.details.EmbeddedIdMappingUiProvider; -import org.eclipse.jpt.ui.internal.details.EmbeddedMappingUiProvider; -import org.eclipse.jpt.ui.internal.details.IdMappingUiProvider; -import org.eclipse.jpt.ui.internal.details.ManyToManyMappingUiProvider; -import org.eclipse.jpt.ui.internal.details.ManyToOneMappingUiProvider; -import org.eclipse.jpt.ui.internal.details.OneToManyMappingUiProvider; -import org.eclipse.jpt.ui.internal.details.OneToOneMappingUiProvider; -import org.eclipse.jpt.ui.internal.details.TransientMappingUiProvider; -import org.eclipse.jpt.ui.internal.details.VersionMappingUiProvider; +import org.eclipse.jpt.utility.internal.CollectionTools; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -85,18 +77,7 @@ public class AddPersistentAttributeToXmlAndMapDialog extends StatusDialog public void dispose() {} public Object[] getElements(Object inputElement) { - return new Object[] { - BasicMappingUiProvider.instance(), - EmbeddedMappingUiProvider.instance(), - EmbeddedIdMappingUiProvider.instance(), - IdMappingUiProvider.instance(), - ManyToManyMappingUiProvider.instance(), - ManyToOneMappingUiProvider.instance(), - OneToManyMappingUiProvider.instance(), - OneToOneMappingUiProvider.instance(), - TransientMappingUiProvider.instance(), - VersionMappingUiProvider.instance() - }; + return CollectionTools.array(((JpaPlatformUi) inputElement).ormAttributeMappingUiProviders()); } public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} @@ -113,7 +94,8 @@ public class AddPersistentAttributeToXmlAndMapDialog extends StatusDialog validate(); } }); - mappingCombo.setInput("FOO"); + JpaPlatformUi jpaPlatformUi = JptUiPlugin.getPlugin().jpaPlatformUi(this.unmappedPersistentAttribute.getJpaProject().getJpaPlatform()); + mappingCombo.setInput(jpaPlatformUi); mappingCombo.getCombo().select(0); // select Basic to begin // TODO - F1 Help diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmItemLabelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmItemLabelProviderFactory.java index 531f515718..842728ddc9 100644 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmItemLabelProviderFactory.java +++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmItemLabelProviderFactory.java @@ -16,11 +16,12 @@ import org.eclipse.jpt.ui.jface.ItemLabelProvider; public class OrmItemLabelProviderFactory extends GeneralJpaMappingItemLabelProviderFactory { + @Override public ItemLabelProvider buildItemLabelProvider( Object item, DelegatingContentAndLabelProvider labelProvider) { if (item instanceof EntityMappings) { return new EntityMappingsItemLabelProvider((EntityMappings) item, labelProvider); } - else return super.buildItemLabelProvider(item, labelProvider); + return super.buildItemLabelProvider(item, labelProvider); } } |