diff options
author | kmoore | 2007-08-21 16:19:36 +0000 |
---|---|---|
committer | kmoore | 2007-08-21 16:19:36 +0000 |
commit | 1051271be2f15cdac8036b2c335720de289b0faf (patch) | |
tree | 720b98c93b8cbcb3fa29b5e38ff7437df421ad52 /jpa | |
parent | b36e406c131758742008e629a2a856f71cc8a3f3 (diff) | |
download | webtools.dali-1051271be2f15cdac8036b2c335720de289b0faf.tar.gz webtools.dali-1051271be2f15cdac8036b2c335720de289b0faf.tar.xz webtools.dali-1051271be2f15cdac8036b2c335720de289b0faf.zip |
200679 - added IColumn defaultLength, defaultPrecision, defaultScale
Diffstat (limited to 'jpa')
30 files changed, 676 insertions, 269 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/old_core.ecore b/jpa/plugins/org.eclipse.jpt.core/model/old_core.ecore index eaf0f0e918..9f78292dc4 100644 --- a/jpa/plugins/org.eclipse.jpt.core/model/old_core.ecore +++ b/jpa/plugins/org.eclipse.jpt.core/model/old_core.ecore @@ -231,10 +231,21 @@ </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="IColumn" abstract="true" interface="true" eSuperTypes="#//mappings/IAbstractColumn"> + <eOperations name="getDefaultLength" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt"/> + <eOperations name="getDefaultPrecision" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt"/> + <eOperations name="getDefaultScale" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="length" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" - defaultValueLiteral="255"/> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="precision" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="scale" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> + changeable="false" volatile="true" derived="true"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="specifiedLength" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt" + defaultValueLiteral="-1"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="precision" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" + changeable="false" volatile="true" derived="true"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="specifiedPrecision" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt" + defaultValueLiteral="-1"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="scale" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" + changeable="false" volatile="true" derived="true"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="specifiedScale" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EInt" + defaultValueLiteral="-1"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="IColumnMapping" abstract="true" interface="true"> <eOperations name="getColumn" eType="#//mappings/IColumn"/> diff --git a/jpa/plugins/org.eclipse.jpt.core/model/old_coreModels.genmodel b/jpa/plugins/org.eclipse.jpt.core/model/old_coreModels.genmodel index da0603b4d0..abf3828c28 100644 --- a/jpa/plugins/org.eclipse.jpt.core/model/old_coreModels.genmodel +++ b/jpa/plugins/org.eclipse.jpt.core/model/old_coreModels.genmodel @@ -226,8 +226,14 @@ </genClasses> <genClasses ecoreClass="old_core.ecore#//mappings/IColumn"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute old_core.ecore#//mappings/IColumn/length"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute old_core.ecore#//mappings/IColumn/specifiedLength"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute old_core.ecore#//mappings/IColumn/precision"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute old_core.ecore#//mappings/IColumn/specifiedPrecision"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute old_core.ecore#//mappings/IColumn/scale"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute old_core.ecore#//mappings/IColumn/specifiedScale"/> + <genOperations ecoreOperation="old_core.ecore#//mappings/IColumn/getDefaultLength"/> + <genOperations ecoreOperation="old_core.ecore#//mappings/IColumn/getDefaultPrecision"/> + <genOperations ecoreOperation="old_core.ecore#//mappings/IColumn/getDefaultScale"/> </genClasses> <genClasses ecoreClass="old_core.ecore#//mappings/IColumnMapping"> <genOperations ecoreOperation="old_core.ecore#//mappings/IColumnMapping/getColumn"/> diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaDataSource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaDataSource.java index 013f184c83..4aae51c938 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaDataSource.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaDataSource.java @@ -9,7 +9,6 @@ ******************************************************************************/ package org.eclipse.jpt.core.internal; - /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>IJpa Data Source</b></em>'. @@ -33,6 +32,6 @@ public interface IJpaDataSource extends IJpaEObject void setConnectionProfileName(String newConnectionProfileName); boolean isConnected(); - + boolean hasAConnection(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFactory.java index 1e5745e566..57d388eebb 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFactory.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaFactory.java @@ -24,6 +24,7 @@ import org.eclipse.jpt.core.internal.content.java.mappings.IJavaTransient; import org.eclipse.jpt.core.internal.content.java.mappings.IJavaVersion; import org.eclipse.jpt.core.internal.jdtutility.Attribute; import org.eclipse.jpt.core.internal.jdtutility.Type; +import org.eclipse.jpt.core.internal.platform.BaseJpaFactory; /** * Use IJpaFactory to create any IJavaTypeMapping or IJavaAttributeMappings. This is necessary diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java index dc7e19c07d..1f6cd7e315 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java @@ -97,7 +97,7 @@ public interface IJpaPlatform Iterator<IJavaTypeMappingProvider> javaTypeMappingProviders(); IJavaTypeMappingProvider javaTypeMappingProvider(String typeMappingKey); - + /** * Return an Iterator of IJavaAttributeMappingProviders. These define which * IJavaAttributeMappings are supported and which annotation applies. @@ -105,7 +105,7 @@ public interface IJpaPlatform Iterator<IJavaAttributeMappingProvider> javaAttributeMappingProviders(); IJavaAttributeMappingProvider javaAttributeMappingProvider(String attributeMappingKey); - + /** * Return a ListIterator of IDefaultJavaAttributeMappingProvider. This is a List * because the defaults are checked in order. diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaProject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaProject.java index 5d2bda5af1..c7ffb1dcee 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaProject.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaProject.java @@ -11,7 +11,6 @@ package org.eclipse.jpt.core.internal; import java.util.Collection; import java.util.Iterator; - import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; @@ -154,5 +153,4 @@ public interface IJpaProject extends IJpaEObject void setThreadLocalModifySharedDocumentCommandExecutor(CommandExecutor commandExecutor); CommandExecutorProvider modifySharedDocumentCommandExecutorProvider(); - } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProject.java index 52b90e9e8f..6276876487 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProject.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProject.java @@ -148,7 +148,7 @@ public class JpaProject extends JpaEObject implements IJpaProject * This is set to false when that job is completed */ boolean resynching = false; - + /** * Flag to indicate that the disposing job has been scheduled or is running * (or has been run, in some cases) @@ -174,7 +174,6 @@ public class JpaProject extends JpaEObject implements IJpaProject private ThreadLocal<CommandExecutor> threadLocalModifySharedDocumentCommandExecutor = new ThreadLocal<CommandExecutor>(); - JpaProject() { super(); } @@ -192,7 +191,10 @@ public class JpaProject extends JpaEObject implements IJpaProject @Override protected IStatus run(IProgressMonitor monitor) { IContext contextHierarchy = getPlatform().buildProjectContext(); + long start = System.currentTimeMillis(); getPlatform().resynch(contextHierarchy); + long end = System.currentTimeMillis(); + System.out.println((end - start) + " ms - resynch"); return Status.OK_STATUS; } }; @@ -502,6 +504,7 @@ public class JpaProject extends JpaEObject implements IJpaProject if (filled) { return; } + long start = System.currentTimeMillis(); IResourceProxyVisitor visitor = new IResourceProxyVisitor() { public boolean visit(IResourceProxy resource) throws CoreException { switch (resource.getType()) { @@ -519,6 +522,8 @@ public class JpaProject extends JpaEObject implements IJpaProject } }; getProject().accept(visitor, IResource.NONE); + long end = System.currentTimeMillis(); + System.out.println(end - start + " ms - fill"); filled = true; resynch(); } @@ -579,10 +584,9 @@ public class JpaProject extends JpaEObject implements IJpaProject * Dispose and remove project */ void dispose() { - if (disposing) return; - + if (disposing) + return; disposing = true; - Job job = new Job("Disposing JPA project ...") { @Override protected IStatus run(IProgressMonitor monitor) { @@ -593,7 +597,7 @@ public class JpaProject extends JpaEObject implements IJpaProject job.setRule(project); job.schedule(); } - + private void dispose_() { Job.getJobManager().removeJobChangeListener(resynchJobListener); for (IJpaFile jpaFile : CollectionTools.collection(getFiles())) { @@ -643,24 +647,21 @@ public class JpaProject extends JpaEObject implements IJpaProject }; } - // PWFTODO - // Return a NullPersistenceFile if no content found? + // PWFTODO + // Return a NullPersistenceFile if no content found? synchronized IJpaFile createJpaFile(IFile file) { if (!JavaCore.create(this.project).isOnClasspath(file)) { return null; } - IContentType contentType = this.contentType(file); if (contentType == null) { return null; } - String contentTypeId = contentType.getId(); IJpaFileContentProvider provider = this.getPlatform().fileContentProvider(contentTypeId); if (provider == null) { return null; } - JpaFile jpaFile = JpaCoreFactory.eINSTANCE.createJpaFile(); this.getFiles().add(jpaFile); jpaFile.setFile(file); @@ -675,9 +676,11 @@ public class JpaProject extends JpaEObject implements IJpaProject private IContentType contentType(IFile file) { try { return Platform.getContentTypeManager().findContentTypeFor(file.getContents(), file.getName()); - } catch (IOException ex) { + } + catch (IOException ex) { JptCorePlugin.log(ex); - } catch (CoreException ex) { + } + catch (CoreException ex) { JptCorePlugin.log(ex); } return null; @@ -707,9 +710,9 @@ public class JpaProject extends JpaEObject implements IJpaProject //multiple projects having cross-references public void resynch() { //don't resynch until the project is filled - if (disposing || !filled) return; - - if (! this.resynching) { + if (disposing || !filled) + return; + if (!this.resynching) { this.resynching = true; this.needsToResynch = false; this.resynchJob.schedule(); @@ -854,11 +857,15 @@ public class JpaProject extends JpaEObject implements IJpaProject return this.modifySharedDocumentCommandExecutorProvider; } + // ********** member class ********** - private class ModifySharedDocumentCommandExecutorProvider implements CommandExecutorProvider { + private class ModifySharedDocumentCommandExecutorProvider + implements CommandExecutorProvider + { ModifySharedDocumentCommandExecutorProvider() { super(); } + public CommandExecutor commandExecutor() { return JpaProject.this.getThreadLocalModifySharedDocumentCommandExecutor(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMapping.java index e1ebfeb0d3..5b2f5cae3b 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/IJavaAttributeMapping.java @@ -27,7 +27,6 @@ import org.eclipse.jpt.utility.internal.Filter; */ public interface IJavaAttributeMapping extends IAttributeMapping { - void updateFromJava(CompilationUnit astRoot); /** diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentAttribute.java index e258d895f7..25596bfe79 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentAttribute.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentAttribute.java @@ -92,7 +92,6 @@ public class JavaPersistentAttribute extends JavaEObject return jpaPlatform().javaAttributeMappingProviders(); } - private ListIterator<IDefaultJavaAttributeMappingProvider> defaultAttributeMappingProviders() { return jpaPlatform().defaultJavaAttributeMappingProviders(); } @@ -525,7 +524,7 @@ public class JavaPersistentAttribute extends JavaEObject * return null if we can't find a mapping annotation on the attribute */ private IJavaAttributeMappingProvider javaAttributeMappingProvider(CompilationUnit astRoot) { - for (Iterator<IJavaAttributeMappingProvider> i = this.attributeMappingProviders(); i.hasNext(); ) { + for (Iterator<IJavaAttributeMappingProvider> i = this.attributeMappingProviders(); i.hasNext();) { IJavaAttributeMappingProvider provider = i.next(); if (this.attribute.containsAnnotation(provider.declarationAnnotationAdapter(), astRoot)) { return provider; @@ -577,7 +576,7 @@ public class JavaPersistentAttribute extends JavaEObject * return the null provider if we can't find a provider */ private IJavaAttributeMappingProvider defaultAttributeMappingProvider(DefaultsContext defaultsContext) { - for (Iterator<IDefaultJavaAttributeMappingProvider> i = this.defaultAttributeMappingProviders(); i.hasNext(); ) { + for (Iterator<IDefaultJavaAttributeMappingProvider> i = this.defaultAttributeMappingProviders(); i.hasNext();) { IDefaultJavaAttributeMappingProvider provider = i.next(); if (provider.defaultApplies(this.attribute, defaultsContext)) { return provider; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java index 2063d25bff..8266ee960e 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java @@ -696,7 +696,7 @@ public class JavaPersistentType extends JavaEObject implements IPersistentType } private String javaTypeMappingKey(CompilationUnit astRoot) { - for (Iterator<IJavaTypeMappingProvider> i = this.typeMappingProviders(); i.hasNext(); ) { + for (Iterator<IJavaTypeMappingProvider> i = this.typeMappingProviders(); i.hasNext();) { IJavaTypeMappingProvider provider = i.next(); if (this.type.containsAnnotation(provider.declarationAnnotationAdapter(), astRoot)) { return provider.key(); @@ -857,7 +857,7 @@ public class JavaPersistentType extends JavaEObject implements IPersistentType boolean hasPersistableProperties = false; for (IField field : AttributeAnnotationTools.persistableFields(jdtType)) { hasPersistableFields = true; - FieldAttribute fa = new FieldAttribute(field, null); // a bit hacky... + FieldAttribute fa = new FieldAttribute(field, null); // a bit hacky... if (fa.containsAnyAnnotation(this.attributeMappingAnnotationAdapters, astRoot)) { // any field is annotated => FIELD return AccessType.FIELD; @@ -865,7 +865,7 @@ public class JavaPersistentType extends JavaEObject implements IPersistentType } for (IMethod method : AttributeAnnotationTools.persistablePropertyGetters(jdtType)) { hasPersistableProperties = true; - MethodAttribute ma = new MethodAttribute(method, null); // a bit hacky... + MethodAttribute ma = new MethodAttribute(method, null); // a bit hacky... if (ma.containsAnyAnnotation(this.attributeMappingAnnotationAdapters, astRoot)) { // none of the fields are annotated and a getter is annotated => PROPERTY return AccessType.PROPERTY; @@ -881,12 +881,12 @@ public class JavaPersistentType extends JavaEObject implements IPersistentType public void refreshDefaults(DefaultsContext context) { refreshParentPersistentType(context); } - + private void refreshParentPersistentType(DefaultsContext context) { ITypeBinding typeBinding = getType().typeBinding(context.astRoot()); this.parentPersistentType = parentPersistentType(context, typeBinding); } - + public static IPersistentType parentPersistentType(DefaultsContext context, ITypeBinding typeBinding) { if (typeBinding == null) { return null; @@ -905,6 +905,5 @@ public class JavaPersistentType extends JavaEObject implements IPersistentType return possibleParent; } return possibleParent.parentPersistentType(); - } }
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaCompilationUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaCompilationUnit.java index f7e19648dc..11ce9ea727 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaCompilationUnit.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaCompilationUnit.java @@ -13,7 +13,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; - import org.eclipse.core.resources.IFile; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaFactory.java index ff55bf5503..240fbbaa3a 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaFactory.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaFactory.java @@ -42,7 +42,7 @@ public class JpaJavaFactory extends EFactoryImpl */ public static JpaJavaFactory init() { try { - JpaJavaFactory theJpaJavaFactory = (JpaJavaFactory) EPackage.Registry.INSTANCE.getEFactory("jpt.java.xmi"); + JpaJavaFactory theJpaJavaFactory = (JpaJavaFactory) EPackage.Registry.INSTANCE.getEFactory("http://org.eclipse.jpt.core/old_java.ecore"); if (theJpaJavaFactory != null) { return theJpaJavaFactory; } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java index d624b579cc..539f07fe5a 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java @@ -52,7 +52,7 @@ public class JpaJavaPackage extends EPackageImpl * <!-- end-user-doc --> * @generated */ - public static final String eNS_URI = "jpt.java.xmi"; + public static final String eNS_URI = "http://org.eclipse.jpt.core/old_java.ecore"; /** * The package namespace name. @@ -654,9 +654,7 @@ public class JpaJavaPackage extends EPackageImpl initEReference(getJavaPersistentAttribute_DefaultMapping(), this.getIJavaAttributeMapping(), null, "defaultMapping", null, 1, 1, JavaPersistentAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getJavaPersistentAttribute_SpecifiedMapping(), this.getIJavaAttributeMapping(), null, "specifiedMapping", null, 1, 1, JavaPersistentAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(iJavaTypeMappingEClass, IJavaTypeMapping.class, "IJavaTypeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - addEOperation(iJavaTypeMappingEClass, null, "initialize", 0, 1, IS_UNIQUE, IS_ORDERED); initEClass(iJavaAttributeMappingEClass, IJavaAttributeMapping.class, "IJavaAttributeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - addEOperation(iJavaAttributeMappingEClass, null, "initialize", 0, 1, IS_UNIQUE, IS_ORDERED); // Create resource createResource(eNS_URI); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaColumn.java index c0f8a3c70d..b35341659c 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaColumn.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaColumn.java @@ -42,17 +42,27 @@ public class JavaColumn extends AbstractJavaColumn implements IColumn * @generated * @ordered */ - protected static final int LENGTH_EDEFAULT = 255; + protected static final int LENGTH_EDEFAULT = 0; /** - * The cached value of the '{@link #getLength() <em>Length</em>}' attribute. + * The default value of the '{@link #getSpecifiedLength() <em>Specified Length</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getLength() + * @see #getSpecifiedLength() * @generated * @ordered */ - protected int length = LENGTH_EDEFAULT; + protected static final int SPECIFIED_LENGTH_EDEFAULT = -1; + + /** + * The cached value of the '{@link #getSpecifiedLength() <em>Specified Length</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSpecifiedLength() + * @generated + * @ordered + */ + protected int specifiedLength = SPECIFIED_LENGTH_EDEFAULT; /** * The default value of the '{@link #getPrecision() <em>Precision</em>}' attribute. @@ -65,14 +75,24 @@ public class JavaColumn extends AbstractJavaColumn implements IColumn protected static final int PRECISION_EDEFAULT = 0; /** - * The cached value of the '{@link #getPrecision() <em>Precision</em>}' attribute. + * The default value of the '{@link #getSpecifiedPrecision() <em>Specified Precision</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getPrecision() + * @see #getSpecifiedPrecision() + * @generated + * @ordered + */ + protected static final int SPECIFIED_PRECISION_EDEFAULT = -1; + + /** + * The cached value of the '{@link #getSpecifiedPrecision() <em>Specified Precision</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSpecifiedPrecision() * @generated * @ordered */ - protected int precision = PRECISION_EDEFAULT; + protected int specifiedPrecision = SPECIFIED_PRECISION_EDEFAULT; /** * The default value of the '{@link #getScale() <em>Scale</em>}' attribute. @@ -85,14 +105,24 @@ public class JavaColumn extends AbstractJavaColumn implements IColumn protected static final int SCALE_EDEFAULT = 0; /** - * The cached value of the '{@link #getScale() <em>Scale</em>}' attribute. + * The default value of the '{@link #getSpecifiedScale() <em>Specified Scale</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getScale() + * @see #getSpecifiedScale() * @generated * @ordered */ - protected int scale = SCALE_EDEFAULT; + protected static final int SPECIFIED_SCALE_EDEFAULT = -1; + + /** + * The cached value of the '{@link #getSpecifiedScale() <em>Specified Scale</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSpecifiedScale() + * @generated + * @ordered + */ + protected int specifiedScale = SPECIFIED_SCALE_EDEFAULT; private final IntAnnotationElementAdapter lengthAdapter; @@ -178,104 +208,130 @@ public class JavaColumn extends AbstractJavaColumn implements IColumn return JpaJavaMappingsPackage.Literals.JAVA_COLUMN; } + public int getLength() { + return (this.getSpecifiedLength() == SPECIFIED_LENGTH_EDEFAULT) ? getDefaultLength() : this.getSpecifiedLength(); + } + /** - * Returns the value of the '<em><b>Length</b></em>' attribute. - * The default value is <code>"255"</code>. + * Returns the value of the '<em><b>Specified Length</b></em>' attribute. + * The default value is <code>"-1"</code>. * <!-- begin-user-doc --> * <p> - * If the meaning of the '<em>Length</em>' attribute isn't clear, + * If the meaning of the '<em>Specified Length</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> - * @return the value of the '<em>Length</em>' attribute. - * @see #setLength(int) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIColumn_Length() - * @model default="255" + * @return the value of the '<em>Specified Length</em>' attribute. + * @see #setSpecifiedLength(int) + * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIColumn_SpecifiedLength() + * @model default="-1" * @generated */ - public int getLength() { - return length; + public int getSpecifiedLength() { + return specifiedLength; } /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn#getLength <em>Length</em>}' attribute. + * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn#getSpecifiedLength <em>Specified Length</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @param value the new value of the '<em>Length</em>' attribute. - * @see #getLength() + * @param value the new value of the '<em>Specified Length</em>' attribute. + * @see #getSpecifiedLength() * @generated */ - public void setLength(int newLength) { - int oldLength = length; - length = newLength; + public void setSpecifiedLength(int newSpecifiedLength) { + int oldSpecifiedLength = specifiedLength; + specifiedLength = newSpecifiedLength; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH, oldLength, length)); + eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_LENGTH, oldSpecifiedLength, specifiedLength)); + } + + public int getPrecision() { + return (this.getSpecifiedPrecision() == SPECIFIED_PRECISION_EDEFAULT) ? getDefaultPrecision() : this.getSpecifiedPrecision(); } /** - * Returns the value of the '<em><b>Precision</b></em>' attribute. + * Returns the value of the '<em><b>Specified Precision</b></em>' attribute. + * The default value is <code>"-1"</code>. * <!-- begin-user-doc --> * <p> - * If the meaning of the '<em>Precision</em>' attribute isn't clear, + * If the meaning of the '<em>Specified Precision</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> - * @return the value of the '<em>Precision</em>' attribute. - * @see #setPrecision(int) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIColumn_Precision() - * @model + * @return the value of the '<em>Specified Precision</em>' attribute. + * @see #setSpecifiedPrecision(int) + * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIColumn_SpecifiedPrecision() + * @model default="-1" * @generated */ - public int getPrecision() { - return precision; + public int getSpecifiedPrecision() { + return specifiedPrecision; } /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn#getPrecision <em>Precision</em>}' attribute. + * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn#getSpecifiedPrecision <em>Specified Precision</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @param value the new value of the '<em>Precision</em>' attribute. - * @see #getPrecision() + * @param value the new value of the '<em>Specified Precision</em>' attribute. + * @see #getSpecifiedPrecision() * @generated */ - public void setPrecision(int newPrecision) { - int oldPrecision = precision; - precision = newPrecision; + public void setSpecifiedPrecision(int newSpecifiedPrecision) { + int oldSpecifiedPrecision = specifiedPrecision; + specifiedPrecision = newSpecifiedPrecision; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION, oldPrecision, precision)); + eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_PRECISION, oldSpecifiedPrecision, specifiedPrecision)); + } + + public int getScale() { + return (this.getSpecifiedScale() == SPECIFIED_SCALE_EDEFAULT) ? getDefaultScale() : this.getSpecifiedScale(); } /** - * Returns the value of the '<em><b>Scale</b></em>' attribute. + * Returns the value of the '<em><b>Specified Scale</b></em>' attribute. + * The default value is <code>"-1"</code>. * <!-- begin-user-doc --> * <p> - * If the meaning of the '<em>Scale</em>' attribute isn't clear, + * If the meaning of the '<em>Specified Scale</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> - * @return the value of the '<em>Scale</em>' attribute. - * @see #setScale(int) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIColumn_Scale() - * @model + * @return the value of the '<em>Specified Scale</em>' attribute. + * @see #setSpecifiedScale(int) + * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIColumn_SpecifiedScale() + * @model default="-1" * @generated */ - public int getScale() { - return scale; + public int getSpecifiedScale() { + return specifiedScale; } /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn#getScale <em>Scale</em>}' attribute. + * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn#getSpecifiedScale <em>Specified Scale</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @param value the new value of the '<em>Scale</em>' attribute. - * @see #getScale() + * @param value the new value of the '<em>Specified Scale</em>' attribute. + * @see #getSpecifiedScale() * @generated */ - public void setScale(int newScale) { - int oldScale = scale; - scale = newScale; + public void setSpecifiedScale(int newSpecifiedScale) { + int oldSpecifiedScale = specifiedScale; + specifiedScale = newSpecifiedScale; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_COLUMN__SCALE, oldScale, scale)); + eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_SCALE, oldSpecifiedScale, specifiedScale)); + } + + public int getDefaultLength() { + return DEFAULT_LENGTH; + } + + public int getDefaultPrecision() { + return DEFAULT_PRECISION; + } + + public int getDefaultScale() { + return DEFAULT_SCALE; } /** @@ -288,10 +344,16 @@ public class JavaColumn extends AbstractJavaColumn implements IColumn switch (featureID) { case JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH : return new Integer(getLength()); + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_LENGTH : + return new Integer(getSpecifiedLength()); case JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION : return new Integer(getPrecision()); + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_PRECISION : + return new Integer(getSpecifiedPrecision()); case JpaJavaMappingsPackage.JAVA_COLUMN__SCALE : return new Integer(getScale()); + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_SCALE : + return new Integer(getSpecifiedScale()); } return super.eGet(featureID, resolve, coreType); } @@ -304,14 +366,14 @@ public class JavaColumn extends AbstractJavaColumn implements IColumn @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH : - setLength(((Integer) newValue).intValue()); + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_LENGTH : + setSpecifiedLength(((Integer) newValue).intValue()); return; - case JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION : - setPrecision(((Integer) newValue).intValue()); + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_PRECISION : + setSpecifiedPrecision(((Integer) newValue).intValue()); return; - case JpaJavaMappingsPackage.JAVA_COLUMN__SCALE : - setScale(((Integer) newValue).intValue()); + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_SCALE : + setSpecifiedScale(((Integer) newValue).intValue()); return; } super.eSet(featureID, newValue); @@ -325,14 +387,14 @@ public class JavaColumn extends AbstractJavaColumn implements IColumn @Override public void eUnset(int featureID) { switch (featureID) { - case JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH : - setLength(LENGTH_EDEFAULT); + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_LENGTH : + setSpecifiedLength(SPECIFIED_LENGTH_EDEFAULT); return; - case JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION : - setPrecision(PRECISION_EDEFAULT); + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_PRECISION : + setSpecifiedPrecision(SPECIFIED_PRECISION_EDEFAULT); return; - case JpaJavaMappingsPackage.JAVA_COLUMN__SCALE : - setScale(SCALE_EDEFAULT); + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_SCALE : + setSpecifiedScale(SPECIFIED_SCALE_EDEFAULT); return; } super.eUnset(featureID); @@ -347,11 +409,17 @@ public class JavaColumn extends AbstractJavaColumn implements IColumn public boolean eIsSet(int featureID) { switch (featureID) { case JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH : - return length != LENGTH_EDEFAULT; + return getLength() != LENGTH_EDEFAULT; + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_LENGTH : + return specifiedLength != SPECIFIED_LENGTH_EDEFAULT; case JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION : - return precision != PRECISION_EDEFAULT; + return getPrecision() != PRECISION_EDEFAULT; + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_PRECISION : + return specifiedPrecision != SPECIFIED_PRECISION_EDEFAULT; case JpaJavaMappingsPackage.JAVA_COLUMN__SCALE : - return scale != SCALE_EDEFAULT; + return getScale() != SCALE_EDEFAULT; + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_SCALE : + return specifiedScale != SPECIFIED_SCALE_EDEFAULT; } return super.eIsSet(featureID); } @@ -367,10 +435,16 @@ public class JavaColumn extends AbstractJavaColumn implements IColumn switch (derivedFeatureID) { case JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH : return JpaCoreMappingsPackage.ICOLUMN__LENGTH; + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_LENGTH : + return JpaCoreMappingsPackage.ICOLUMN__SPECIFIED_LENGTH; case JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION : return JpaCoreMappingsPackage.ICOLUMN__PRECISION; + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_PRECISION : + return JpaCoreMappingsPackage.ICOLUMN__SPECIFIED_PRECISION; case JpaJavaMappingsPackage.JAVA_COLUMN__SCALE : return JpaCoreMappingsPackage.ICOLUMN__SCALE; + case JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_SCALE : + return JpaCoreMappingsPackage.ICOLUMN__SPECIFIED_SCALE; default : return -1; } @@ -389,10 +463,16 @@ public class JavaColumn extends AbstractJavaColumn implements IColumn switch (baseFeatureID) { case JpaCoreMappingsPackage.ICOLUMN__LENGTH : return JpaJavaMappingsPackage.JAVA_COLUMN__LENGTH; + case JpaCoreMappingsPackage.ICOLUMN__SPECIFIED_LENGTH : + return JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_LENGTH; case JpaCoreMappingsPackage.ICOLUMN__PRECISION : return JpaJavaMappingsPackage.JAVA_COLUMN__PRECISION; + case JpaCoreMappingsPackage.ICOLUMN__SPECIFIED_PRECISION : + return JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_PRECISION; case JpaCoreMappingsPackage.ICOLUMN__SCALE : return JpaJavaMappingsPackage.JAVA_COLUMN__SCALE; + case JpaCoreMappingsPackage.ICOLUMN__SPECIFIED_SCALE : + return JpaJavaMappingsPackage.JAVA_COLUMN__SPECIFIED_SCALE; default : return -1; } @@ -410,12 +490,12 @@ public class JavaColumn extends AbstractJavaColumn implements IColumn if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); - result.append(" (length: "); - result.append(length); - result.append(", precision: "); - result.append(precision); - result.append(", scale: "); - result.append(scale); + result.append(" (specifiedLength: "); + result.append(specifiedLength); + result.append(", specifiedPrecision: "); + result.append(specifiedPrecision); + result.append(", specifiedScale: "); + result.append(specifiedScale); result.append(')'); return result.toString(); } @@ -428,9 +508,9 @@ public class JavaColumn extends AbstractJavaColumn implements IColumn @Override public void updateFromJava(CompilationUnit astRoot) { super.updateFromJava(astRoot); - this.setLength(this.lengthAdapter.getValue(astRoot)); - this.setPrecision(this.precisionAdapter.getValue(astRoot)); - this.setScale(this.scaleAdapter.getValue(astRoot)); + this.setSpecifiedLength(this.lengthAdapter.getValue(astRoot)); + this.setSpecifiedPrecision(this.precisionAdapter.getValue(astRoot)); + this.setSpecifiedScale(this.scaleAdapter.getValue(astRoot)); } public void refreshDefaults(DefaultsContext defaultsContext) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java index d248b6e63b..a66613ab8b 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java @@ -581,11 +581,10 @@ public class JavaEmbedded extends JavaAttributeMapping implements IJavaEmbedded } IPersistentType persistentType = defaultsContext.persistentType(resolvedTypeName); if (persistentType != null) { - if( persistentType.getMappingKey() == IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY) { + if (persistentType.getMappingKey() == IMappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY) { return (IEmbeddable) persistentType.getMapping(); } } return null; } - } // JavaEmbedded diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java index af5eee8943..f96ea4c9c8 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java @@ -12,7 +12,6 @@ package org.eclipse.jpt.core.internal.content.java.mappings; import java.util.Collection; import java.util.Iterator; import java.util.List; - import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclass.java index 0b904311e0..86b4ad7542 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclass.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMappedSuperclass.java @@ -10,7 +10,6 @@ package org.eclipse.jpt.core.internal.content.java.mappings; import java.util.Iterator; - import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java index abfb4c3c9d..37023600eb 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java @@ -10,7 +10,6 @@ package org.eclipse.jpt.core.internal.content.java.mappings; import java.util.Iterator; - import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaUniqueConstraint.java index 01706c49fc..51ec6eea66 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaUniqueConstraint.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaUniqueConstraint.java @@ -11,7 +11,6 @@ package org.eclipse.jpt.core.internal.content.java.mappings; import java.util.Collection; import java.util.Iterator; - import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java index a56ff771f5..0bc3cea56f 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java @@ -3421,13 +3421,31 @@ public class JpaJavaMappingsPackage extends EPackageImpl public static final int JAVA_COLUMN__LENGTH = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 0; /** + * The feature id for the '<em><b>Specified Length</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int JAVA_COLUMN__SPECIFIED_LENGTH = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 1; + + /** * The feature id for the '<em><b>Precision</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int JAVA_COLUMN__PRECISION = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 1; + public static final int JAVA_COLUMN__PRECISION = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 2; + + /** + * The feature id for the '<em><b>Specified Precision</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int JAVA_COLUMN__SPECIFIED_PRECISION = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Scale</b></em>' attribute. @@ -3436,7 +3454,16 @@ public class JpaJavaMappingsPackage extends EPackageImpl * @generated * @ordered */ - public static final int JAVA_COLUMN__SCALE = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 2; + public static final int JAVA_COLUMN__SCALE = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 4; + + /** + * The feature id for the '<em><b>Specified Scale</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int JAVA_COLUMN__SPECIFIED_SCALE = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 5; /** * The number of structural features of the '<em>Java Column</em>' class. @@ -3445,7 +3472,7 @@ public class JpaJavaMappingsPackage extends EPackageImpl * @generated * @ordered */ - public static final int JAVA_COLUMN_FEATURE_COUNT = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 3; + public static final int JAVA_COLUMN_FEATURE_COUNT = ABSTRACT_JAVA_COLUMN_FEATURE_COUNT + 6; /** * The feature id for the '<em><b>Name</b></em>' attribute. diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java index 6494a6e5f5..10e5d2d947 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java @@ -3582,13 +3582,31 @@ public class OrmPackage extends EPackageImpl public static final int XML_COLUMN__LENGTH = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 0; /** + * The feature id for the '<em><b>Specified Length</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_COLUMN__SPECIFIED_LENGTH = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 1; + + /** * The feature id for the '<em><b>Precision</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_COLUMN__PRECISION = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 1; + public static final int XML_COLUMN__PRECISION = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 2; + + /** + * The feature id for the '<em><b>Specified Precision</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_COLUMN__SPECIFIED_PRECISION = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Scale</b></em>' attribute. @@ -3597,7 +3615,16 @@ public class OrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_COLUMN__SCALE = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 2; + public static final int XML_COLUMN__SCALE = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 4; + + /** + * The feature id for the '<em><b>Specified Scale</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_COLUMN__SPECIFIED_SCALE = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 5; /** * The feature id for the '<em><b>Length For Xml</b></em>' attribute. @@ -3606,7 +3633,7 @@ public class OrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_COLUMN__LENGTH_FOR_XML = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 3; + public static final int XML_COLUMN__LENGTH_FOR_XML = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 6; /** * The feature id for the '<em><b>Precision For Xml</b></em>' attribute. @@ -3615,7 +3642,7 @@ public class OrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_COLUMN__PRECISION_FOR_XML = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 4; + public static final int XML_COLUMN__PRECISION_FOR_XML = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 7; /** * The feature id for the '<em><b>Scale For Xml</b></em>' attribute. @@ -3624,7 +3651,7 @@ public class OrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_COLUMN__SCALE_FOR_XML = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 5; + public static final int XML_COLUMN__SCALE_FOR_XML = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 8; /** * The number of structural features of the '<em>Xml Column</em>' class. @@ -3633,7 +3660,7 @@ public class OrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_COLUMN_FEATURE_COUNT = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 6; + public static final int XML_COLUMN_FEATURE_COUNT = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 9; /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlJoinColumn <em>Xml Join Column</em>}' class. diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlColumn.java index 009f658495..fae6f916f7 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlColumn.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlColumn.java @@ -47,17 +47,27 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn * @generated * @ordered */ - protected static final int LENGTH_EDEFAULT = 255; + protected static final int LENGTH_EDEFAULT = 0; /** - * The cached value of the '{@link #getLength() <em>Length</em>}' attribute. + * The default value of the '{@link #getSpecifiedLength() <em>Specified Length</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getLength() + * @see #getSpecifiedLength() * @generated * @ordered */ - protected int length = LENGTH_EDEFAULT; + protected static final int SPECIFIED_LENGTH_EDEFAULT = -1; + + /** + * The cached value of the '{@link #getSpecifiedLength() <em>Specified Length</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSpecifiedLength() + * @generated + * @ordered + */ + protected int specifiedLength = SPECIFIED_LENGTH_EDEFAULT; /** * The default value of the '{@link #getPrecision() <em>Precision</em>}' attribute. @@ -70,14 +80,24 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn protected static final int PRECISION_EDEFAULT = 0; /** - * The cached value of the '{@link #getPrecision() <em>Precision</em>}' attribute. + * The default value of the '{@link #getSpecifiedPrecision() <em>Specified Precision</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getPrecision() + * @see #getSpecifiedPrecision() + * @generated + * @ordered + */ + protected static final int SPECIFIED_PRECISION_EDEFAULT = -1; + + /** + * The cached value of the '{@link #getSpecifiedPrecision() <em>Specified Precision</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSpecifiedPrecision() * @generated * @ordered */ - protected int precision = PRECISION_EDEFAULT; + protected int specifiedPrecision = SPECIFIED_PRECISION_EDEFAULT; /** * The default value of the '{@link #getScale() <em>Scale</em>}' attribute. @@ -90,14 +110,24 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn protected static final int SCALE_EDEFAULT = 0; /** - * The cached value of the '{@link #getScale() <em>Scale</em>}' attribute. + * The default value of the '{@link #getSpecifiedScale() <em>Specified Scale</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getScale() + * @see #getSpecifiedScale() * @generated * @ordered */ - protected int scale = SCALE_EDEFAULT; + protected static final int SPECIFIED_SCALE_EDEFAULT = -1; + + /** + * The cached value of the '{@link #getSpecifiedScale() <em>Specified Scale</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSpecifiedScale() + * @generated + * @ordered + */ + protected int specifiedScale = SPECIFIED_SCALE_EDEFAULT; /** * The default value of the '{@link #getLengthForXml() <em>Length For Xml</em>}' attribute. @@ -152,134 +182,148 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn return OrmPackage.Literals.XML_COLUMN; } + public int getLength() { + return (this.getSpecifiedLength() == SPECIFIED_LENGTH_EDEFAULT) ? getDefaultLength() : this.getSpecifiedLength(); + } + /** - * Returns the value of the '<em><b>Length</b></em>' attribute. - * The default value is <code>"255"</code>. + * Returns the value of the '<em><b>Specified Length</b></em>' attribute. + * The default value is <code>"-1"</code>. * <!-- begin-user-doc --> * <p> - * If the meaning of the '<em>Length</em>' attribute isn't clear, + * If the meaning of the '<em>Specified Length</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> - * @return the value of the '<em>Length</em>' attribute. - * @see #setLength(int) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIColumn_Length() - * @model default="255" + * @return the value of the '<em>Specified Length</em>' attribute. + * @see #setSpecifiedLength(int) + * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIColumn_SpecifiedLength() + * @model default="-1" * @generated */ - public int getLength() { - return length; + public int getSpecifiedLength() { + return specifiedLength; } /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getLength <em>Length</em>}' attribute. + * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getSpecifiedLength <em>Specified Length</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @param value the new value of the '<em>Length</em>' attribute. - * @see #getLength() + * @param value the new value of the '<em>Specified Length</em>' attribute. + * @see #getSpecifiedLength() * @generated */ - public void setLengthGen(int newLength) { - int oldLength = length; - length = newLength; + public void setSpecifiedLengthGen(int newSpecifiedLength) { + int oldSpecifiedLength = specifiedLength; + specifiedLength = newSpecifiedLength; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__LENGTH, oldLength, length)); + eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__SPECIFIED_LENGTH, oldSpecifiedLength, specifiedLength)); } - public void setLength(int newLength) { - setLengthGen(newLength); - if (newLength != LENGTH_EDEFAULT) { + public void setSpecifiedLength(int newSpecifiedLength) { + setSpecifiedLengthGen(newSpecifiedLength); + if (newSpecifiedLength != LENGTH_EDEFAULT) { getColumnMapping().makeColumnForXmlNonNull(); } - setLengthForXml(newLength); + setLengthForXml(newSpecifiedLength); if (isAllFeaturesUnset()) { getColumnMapping().makeColumnForXmlNull(); } } + public int getPrecision() { + return (this.getSpecifiedPrecision() == SPECIFIED_PRECISION_EDEFAULT) ? getDefaultPrecision() : this.getSpecifiedPrecision(); + } + /** - * Returns the value of the '<em><b>Precision</b></em>' attribute. + * Returns the value of the '<em><b>Specified Precision</b></em>' attribute. + * The default value is <code>"-1"</code>. * <!-- begin-user-doc --> * <p> - * If the meaning of the '<em>Precision</em>' attribute isn't clear, + * If the meaning of the '<em>Specified Precision</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> - * @return the value of the '<em>Precision</em>' attribute. - * @see #setPrecision(int) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIColumn_Precision() - * @model + * @return the value of the '<em>Specified Precision</em>' attribute. + * @see #setSpecifiedPrecision(int) + * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIColumn_SpecifiedPrecision() + * @model default="-1" * @generated */ - public int getPrecision() { - return precision; + public int getSpecifiedPrecision() { + return specifiedPrecision; } /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getPrecision <em>Precision</em>}' attribute. + * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getSpecifiedPrecision <em>Specified Precision</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @param value the new value of the '<em>Precision</em>' attribute. - * @see #getPrecision() + * @param value the new value of the '<em>Specified Precision</em>' attribute. + * @see #getSpecifiedPrecision() * @generated */ - public void setPrecisionGen(int newPrecision) { - int oldPrecision = precision; - precision = newPrecision; + public void setSpecifiedPrecisionGen(int newSpecifiedPrecision) { + int oldSpecifiedPrecision = specifiedPrecision; + specifiedPrecision = newSpecifiedPrecision; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__PRECISION, oldPrecision, precision)); + eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__SPECIFIED_PRECISION, oldSpecifiedPrecision, specifiedPrecision)); } - public void setPrecision(int newPrecision) { - setPrecisionGen(newPrecision); - if (newPrecision != PRECISION_EDEFAULT) { + public void setSpecifiedPrecision(int newSpecifiedPrecision) { + setSpecifiedPrecisionGen(newSpecifiedPrecision); + if (newSpecifiedPrecision != PRECISION_EDEFAULT) { getColumnMapping().makeColumnForXmlNonNull(); } - setPrecisionForXml(newPrecision); + setPrecisionForXml(newSpecifiedPrecision); if (isAllFeaturesUnset()) { getColumnMapping().makeColumnForXmlNull(); } } + public int getScale() { + return (this.getSpecifiedScale() == SPECIFIED_SCALE_EDEFAULT) ? getDefaultScale() : this.getSpecifiedScale(); + } + /** - * Returns the value of the '<em><b>Scale</b></em>' attribute. + * Returns the value of the '<em><b>Specified Scale</b></em>' attribute. + * The default value is <code>"-1"</code>. * <!-- begin-user-doc --> * <p> - * If the meaning of the '<em>Scale</em>' attribute isn't clear, + * If the meaning of the '<em>Specified Scale</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> - * @return the value of the '<em>Scale</em>' attribute. - * @see #setScale(int) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIColumn_Scale() - * @model + * @return the value of the '<em>Specified Scale</em>' attribute. + * @see #setSpecifiedScale(int) + * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIColumn_SpecifiedScale() + * @model default="-1" * @generated */ - public int getScale() { - return scale; + public int getSpecifiedScale() { + return specifiedScale; } /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getScale <em>Scale</em>}' attribute. + * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlColumn#getSpecifiedScale <em>Specified Scale</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @param value the new value of the '<em>Scale</em>' attribute. - * @see #getScale() + * @param value the new value of the '<em>Specified Scale</em>' attribute. + * @see #getSpecifiedScale() * @generated */ - public void setScaleGen(int newScale) { - int oldScale = scale; - scale = newScale; + public void setSpecifiedScaleGen(int newSpecifiedScale) { + int oldSpecifiedScale = specifiedScale; + specifiedScale = newSpecifiedScale; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__SCALE, oldScale, scale)); + eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__SPECIFIED_SCALE, oldSpecifiedScale, specifiedScale)); } - public void setScale(int newScale) { - setScaleGen(newScale); - if (newScale != SCALE_EDEFAULT) { + public void setSpecifiedScale(int newSpecifiedScale) { + setSpecifiedScaleGen(newSpecifiedScale); + if (newSpecifiedScale != SCALE_EDEFAULT) { getColumnMapping().makeColumnForXmlNonNull(); } - setScaleForXml(newScale); + setScaleForXml(newSpecifiedScale); if (isAllFeaturesUnset()) { getColumnMapping().makeColumnForXmlNull(); } @@ -313,7 +357,7 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn * @generated NOT */ public void setLengthForXml(int newLengthForXml) { - setLengthGen(newLengthForXml); + setSpecifiedLengthGen(newLengthForXml); if (eNotificationRequired()) //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__LENGTH_FOR_XML, null, newLengthForXml)); @@ -346,7 +390,7 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn * @generated NOT */ public void setPrecisionForXml(int newPrecisionForXml) { - setPrecisionGen(newPrecisionForXml); + setSpecifiedPrecisionGen(newPrecisionForXml); if (eNotificationRequired()) //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__PRECISION_FOR_XML, null, newPrecisionForXml)); @@ -379,12 +423,24 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn * @generated NOT */ public void setScaleForXml(int newScaleForXml) { - setScaleGen(newScaleForXml); + setSpecifiedScaleGen(newScaleForXml); if (eNotificationRequired()) //pass in oldValue of null because we don't store the value from the xml, see super.eNotify() eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__SCALE_FOR_XML, null, newScaleForXml)); } + public int getDefaultLength() { + return DEFAULT_LENGTH; + } + + public int getDefaultPrecision() { + return DEFAULT_PRECISION; + } + + public int getDefaultScale() { + return DEFAULT_SCALE; + } + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -395,10 +451,16 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn switch (featureID) { case OrmPackage.XML_COLUMN__LENGTH : return new Integer(getLength()); + case OrmPackage.XML_COLUMN__SPECIFIED_LENGTH : + return new Integer(getSpecifiedLength()); case OrmPackage.XML_COLUMN__PRECISION : return new Integer(getPrecision()); + case OrmPackage.XML_COLUMN__SPECIFIED_PRECISION : + return new Integer(getSpecifiedPrecision()); case OrmPackage.XML_COLUMN__SCALE : return new Integer(getScale()); + case OrmPackage.XML_COLUMN__SPECIFIED_SCALE : + return new Integer(getSpecifiedScale()); case OrmPackage.XML_COLUMN__LENGTH_FOR_XML : return new Integer(getLengthForXml()); case OrmPackage.XML_COLUMN__PRECISION_FOR_XML : @@ -417,14 +479,14 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case OrmPackage.XML_COLUMN__LENGTH : - setLength(((Integer) newValue).intValue()); + case OrmPackage.XML_COLUMN__SPECIFIED_LENGTH : + setSpecifiedLength(((Integer) newValue).intValue()); return; - case OrmPackage.XML_COLUMN__PRECISION : - setPrecision(((Integer) newValue).intValue()); + case OrmPackage.XML_COLUMN__SPECIFIED_PRECISION : + setSpecifiedPrecision(((Integer) newValue).intValue()); return; - case OrmPackage.XML_COLUMN__SCALE : - setScale(((Integer) newValue).intValue()); + case OrmPackage.XML_COLUMN__SPECIFIED_SCALE : + setSpecifiedScale(((Integer) newValue).intValue()); return; case OrmPackage.XML_COLUMN__LENGTH_FOR_XML : setLengthForXml(((Integer) newValue).intValue()); @@ -447,14 +509,14 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn @Override public void eUnset(int featureID) { switch (featureID) { - case OrmPackage.XML_COLUMN__LENGTH : - setLength(LENGTH_EDEFAULT); + case OrmPackage.XML_COLUMN__SPECIFIED_LENGTH : + setSpecifiedLength(SPECIFIED_LENGTH_EDEFAULT); return; - case OrmPackage.XML_COLUMN__PRECISION : - setPrecision(PRECISION_EDEFAULT); + case OrmPackage.XML_COLUMN__SPECIFIED_PRECISION : + setSpecifiedPrecision(SPECIFIED_PRECISION_EDEFAULT); return; - case OrmPackage.XML_COLUMN__SCALE : - setScale(SCALE_EDEFAULT); + case OrmPackage.XML_COLUMN__SPECIFIED_SCALE : + setSpecifiedScale(SPECIFIED_SCALE_EDEFAULT); return; case OrmPackage.XML_COLUMN__LENGTH_FOR_XML : setLengthForXml(LENGTH_FOR_XML_EDEFAULT); @@ -478,11 +540,17 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn public boolean eIsSet(int featureID) { switch (featureID) { case OrmPackage.XML_COLUMN__LENGTH : - return length != LENGTH_EDEFAULT; + return getLength() != LENGTH_EDEFAULT; + case OrmPackage.XML_COLUMN__SPECIFIED_LENGTH : + return specifiedLength != SPECIFIED_LENGTH_EDEFAULT; case OrmPackage.XML_COLUMN__PRECISION : - return precision != PRECISION_EDEFAULT; + return getPrecision() != PRECISION_EDEFAULT; + case OrmPackage.XML_COLUMN__SPECIFIED_PRECISION : + return specifiedPrecision != SPECIFIED_PRECISION_EDEFAULT; case OrmPackage.XML_COLUMN__SCALE : - return scale != SCALE_EDEFAULT; + return getScale() != SCALE_EDEFAULT; + case OrmPackage.XML_COLUMN__SPECIFIED_SCALE : + return specifiedScale != SPECIFIED_SCALE_EDEFAULT; case OrmPackage.XML_COLUMN__LENGTH_FOR_XML : return getLengthForXml() != LENGTH_FOR_XML_EDEFAULT; case OrmPackage.XML_COLUMN__PRECISION_FOR_XML : @@ -504,10 +572,16 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn switch (derivedFeatureID) { case OrmPackage.XML_COLUMN__LENGTH : return JpaCoreMappingsPackage.ICOLUMN__LENGTH; + case OrmPackage.XML_COLUMN__SPECIFIED_LENGTH : + return JpaCoreMappingsPackage.ICOLUMN__SPECIFIED_LENGTH; case OrmPackage.XML_COLUMN__PRECISION : return JpaCoreMappingsPackage.ICOLUMN__PRECISION; + case OrmPackage.XML_COLUMN__SPECIFIED_PRECISION : + return JpaCoreMappingsPackage.ICOLUMN__SPECIFIED_PRECISION; case OrmPackage.XML_COLUMN__SCALE : return JpaCoreMappingsPackage.ICOLUMN__SCALE; + case OrmPackage.XML_COLUMN__SPECIFIED_SCALE : + return JpaCoreMappingsPackage.ICOLUMN__SPECIFIED_SCALE; default : return -1; } @@ -526,10 +600,16 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn switch (baseFeatureID) { case JpaCoreMappingsPackage.ICOLUMN__LENGTH : return OrmPackage.XML_COLUMN__LENGTH; + case JpaCoreMappingsPackage.ICOLUMN__SPECIFIED_LENGTH : + return OrmPackage.XML_COLUMN__SPECIFIED_LENGTH; case JpaCoreMappingsPackage.ICOLUMN__PRECISION : return OrmPackage.XML_COLUMN__PRECISION; + case JpaCoreMappingsPackage.ICOLUMN__SPECIFIED_PRECISION : + return OrmPackage.XML_COLUMN__SPECIFIED_PRECISION; case JpaCoreMappingsPackage.ICOLUMN__SCALE : return OrmPackage.XML_COLUMN__SCALE; + case JpaCoreMappingsPackage.ICOLUMN__SPECIFIED_SCALE : + return OrmPackage.XML_COLUMN__SPECIFIED_SCALE; default : return -1; } @@ -547,12 +627,12 @@ public class XmlColumn extends AbstractXmlColumn implements IColumn if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); - result.append(" (length: "); - result.append(length); - result.append(", precision: "); - result.append(precision); - result.append(", scale: "); - result.append(scale); + result.append(" (specifiedLength: "); + result.append(specifiedLength); + result.append(", specifiedPrecision: "); + result.append(specifiedPrecision); + result.append(", specifiedScale: "); + result.append(specifiedScale); result.append(')'); return result.toString(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java index baaad96267..6e0eb00c48 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java @@ -833,5 +833,4 @@ public abstract class XmlMultiRelationshipMappingInternal protected String javaDefaultTargetEntityFromContainer(ITypeBinding typeBinding) { return JavaMultiRelationshipMapping.javaDefaultTargetEntityFromContainer(typeBinding); } - } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java index 82057b2c34..82fc48a0e0 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java @@ -25,7 +25,6 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.EObjectEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.dom.ITypeBinding; import org.eclipse.jpt.core.internal.IJpaContentNode; import org.eclipse.jpt.core.internal.IJpaFile; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java index de32cb2bf7..96debff57b 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java @@ -570,9 +570,8 @@ public abstract class XmlRelationshipMapping extends XmlAttributeMapping protected String javaDefaultTargetEntity(ITypeBinding typeBinding) { return buildReferenceEntityTypeName(typeBinding); } - + protected String buildReferenceEntityTypeName(ITypeBinding typeBinding) { return JavaRelationshipMapping.buildReferenceEntityTypeName(typeBinding); } - } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUtils.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUtils.java index 1445304a70..c48c2b5db6 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUtils.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUtils.java @@ -20,7 +20,6 @@ import org.eclipse.jpt.core.internal.JpaPlatformRegistry; import org.eclipse.jpt.core.internal.JpaProject; import org.eclipse.jpt.core.internal.JptCorePlugin; import org.eclipse.jpt.core.internal.platform.generic.GenericPlatform; -import org.eclipse.jpt.db.internal.ConnectionProfileRepository; import org.osgi.service.prefs.BackingStoreException; public class JpaFacetUtils diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumn.java index aaf84672e9..9abbc8f498 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumn.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IColumn.java @@ -20,8 +20,11 @@ import org.eclipse.jpt.core.internal.platform.DefaultsContext; * The following features are supported: * <ul> * <li>{@link org.eclipse.jpt.core.internal.mappings.IColumn#getLength <em>Length</em>}</li> + * <li>{@link org.eclipse.jpt.core.internal.mappings.IColumn#getSpecifiedLength <em>Specified Length</em>}</li> * <li>{@link org.eclipse.jpt.core.internal.mappings.IColumn#getPrecision <em>Precision</em>}</li> + * <li>{@link org.eclipse.jpt.core.internal.mappings.IColumn#getSpecifiedPrecision <em>Specified Precision</em>}</li> * <li>{@link org.eclipse.jpt.core.internal.mappings.IColumn#getScale <em>Scale</em>}</li> + * <li>{@link org.eclipse.jpt.core.internal.mappings.IColumn#getSpecifiedScale <em>Specified Scale</em>}</li> * </ul> * </p> * @@ -31,9 +34,14 @@ import org.eclipse.jpt.core.internal.platform.DefaultsContext; */ public interface IColumn extends IAbstractColumn { + int DEFAULT_LENGTH = 255; + + int DEFAULT_PRECISION = 0; + + int DEFAULT_SCALE = 0; + /** * Returns the value of the '<em><b>Length</b></em>' attribute. - * The default value is <code>"255"</code>. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Length</em>' attribute isn't clear, @@ -41,22 +49,38 @@ public interface IColumn extends IAbstractColumn * </p> * <!-- end-user-doc --> * @return the value of the '<em>Length</em>' attribute. - * @see #setLength(int) * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumn_Length() - * @model default="255" + * @model changeable="false" volatile="true" derived="true" * @generated */ int getLength(); /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getLength <em>Length</em>}' attribute. + * Returns the value of the '<em><b>Specified Length</b></em>' attribute. + * The default value is <code>"-1"</code>. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Specified Length</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Specified Length</em>' attribute. + * @see #setSpecifiedLength(int) + * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumn_SpecifiedLength() + * @model default="-1" + * @generated + */ + int getSpecifiedLength(); + + /** + * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getSpecifiedLength <em>Specified Length</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @param value the new value of the '<em>Length</em>' attribute. - * @see #getLength() + * @param value the new value of the '<em>Specified Length</em>' attribute. + * @see #getSpecifiedLength() * @generated */ - void setLength(int value); + void setSpecifiedLength(int value); /** * Returns the value of the '<em><b>Precision</b></em>' attribute. @@ -67,22 +91,38 @@ public interface IColumn extends IAbstractColumn * </p> * <!-- end-user-doc --> * @return the value of the '<em>Precision</em>' attribute. - * @see #setPrecision(int) * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumn_Precision() - * @model + * @model changeable="false" volatile="true" derived="true" * @generated */ int getPrecision(); /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getPrecision <em>Precision</em>}' attribute. + * Returns the value of the '<em><b>Specified Precision</b></em>' attribute. + * The default value is <code>"-1"</code>. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Specified Precision</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Specified Precision</em>' attribute. + * @see #setSpecifiedPrecision(int) + * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumn_SpecifiedPrecision() + * @model default="-1" + * @generated + */ + int getSpecifiedPrecision(); + + /** + * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getSpecifiedPrecision <em>Specified Precision</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @param value the new value of the '<em>Precision</em>' attribute. - * @see #getPrecision() + * @param value the new value of the '<em>Specified Precision</em>' attribute. + * @see #getSpecifiedPrecision() * @generated */ - void setPrecision(int value); + void setSpecifiedPrecision(int value); /** * Returns the value of the '<em><b>Scale</b></em>' attribute. @@ -93,22 +133,62 @@ public interface IColumn extends IAbstractColumn * </p> * <!-- end-user-doc --> * @return the value of the '<em>Scale</em>' attribute. - * @see #setScale(int) * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumn_Scale() - * @model + * @model changeable="false" volatile="true" derived="true" * @generated */ int getScale(); /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getScale <em>Scale</em>}' attribute. + * Returns the value of the '<em><b>Specified Scale</b></em>' attribute. + * The default value is <code>"-1"</code>. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Specified Scale</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Specified Scale</em>' attribute. + * @see #setSpecifiedScale(int) + * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumn_SpecifiedScale() + * @model default="-1" + * @generated + */ + int getSpecifiedScale(); + + /** + * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getSpecifiedScale <em>Specified Scale</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Specified Scale</em>' attribute. + * @see #getSpecifiedScale() + * @generated + */ + void setSpecifiedScale(int value); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + int getDefaultLength(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" + * @generated + */ + int getDefaultPrecision(); + + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @param value the new value of the '<em>Scale</em>' attribute. - * @see #getScale() + * @model kind="operation" * @generated */ - void setScale(int value); + int getDefaultScale(); void refreshDefaults(DefaultsContext defaultsContext); diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java index 35eb236fa6..2cd8c084dc 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java @@ -827,13 +827,31 @@ public class JpaCoreMappingsPackage extends EPackageImpl public static final int ICOLUMN__LENGTH = IABSTRACT_COLUMN_FEATURE_COUNT + 0; /** + * The feature id for the '<em><b>Specified Length</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ICOLUMN__SPECIFIED_LENGTH = IABSTRACT_COLUMN_FEATURE_COUNT + 1; + + /** * The feature id for the '<em><b>Precision</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int ICOLUMN__PRECISION = IABSTRACT_COLUMN_FEATURE_COUNT + 1; + public static final int ICOLUMN__PRECISION = IABSTRACT_COLUMN_FEATURE_COUNT + 2; + + /** + * The feature id for the '<em><b>Specified Precision</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ICOLUMN__SPECIFIED_PRECISION = IABSTRACT_COLUMN_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Scale</b></em>' attribute. @@ -842,7 +860,16 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @generated * @ordered */ - public static final int ICOLUMN__SCALE = IABSTRACT_COLUMN_FEATURE_COUNT + 2; + public static final int ICOLUMN__SCALE = IABSTRACT_COLUMN_FEATURE_COUNT + 4; + + /** + * The feature id for the '<em><b>Specified Scale</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ICOLUMN__SPECIFIED_SCALE = IABSTRACT_COLUMN_FEATURE_COUNT + 5; /** * The number of structural features of the '<em>IColumn</em>' class. @@ -851,7 +878,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @generated * @ordered */ - public static final int ICOLUMN_FEATURE_COUNT = IABSTRACT_COLUMN_FEATURE_COUNT + 3; + public static final int ICOLUMN_FEATURE_COUNT = IABSTRACT_COLUMN_FEATURE_COUNT + 6; /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IColumnMapping <em>IColumn Mapping</em>}' class. @@ -4733,6 +4760,19 @@ public class JpaCoreMappingsPackage extends EPackageImpl } /** + * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getSpecifiedLength <em>Specified Length</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Specified Length</em>'. + * @see org.eclipse.jpt.core.internal.mappings.IColumn#getSpecifiedLength() + * @see #getIColumn() + * @generated + */ + public EAttribute getIColumn_SpecifiedLength() { + return (EAttribute) iColumnEClass.getEStructuralFeatures().get(1); + } + + /** * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getPrecision <em>Precision</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -4742,7 +4782,20 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @generated */ public EAttribute getIColumn_Precision() { - return (EAttribute) iColumnEClass.getEStructuralFeatures().get(1); + return (EAttribute) iColumnEClass.getEStructuralFeatures().get(2); + } + + /** + * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getSpecifiedPrecision <em>Specified Precision</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Specified Precision</em>'. + * @see org.eclipse.jpt.core.internal.mappings.IColumn#getSpecifiedPrecision() + * @see #getIColumn() + * @generated + */ + public EAttribute getIColumn_SpecifiedPrecision() { + return (EAttribute) iColumnEClass.getEStructuralFeatures().get(3); } /** @@ -4755,7 +4808,20 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @generated */ public EAttribute getIColumn_Scale() { - return (EAttribute) iColumnEClass.getEStructuralFeatures().get(2); + return (EAttribute) iColumnEClass.getEStructuralFeatures().get(4); + } + + /** + * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IColumn#getSpecifiedScale <em>Specified Scale</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Specified Scale</em>'. + * @see org.eclipse.jpt.core.internal.mappings.IColumn#getSpecifiedScale() + * @see #getIColumn() + * @generated + */ + public EAttribute getIColumn_SpecifiedScale() { + return (EAttribute) iColumnEClass.getEStructuralFeatures().get(5); } /** @@ -6594,8 +6660,11 @@ public class JpaCoreMappingsPackage extends EPackageImpl createEAttribute(iAbstractColumnEClass, IABSTRACT_COLUMN__DEFAULT_TABLE); iColumnEClass = createEClass(ICOLUMN); createEAttribute(iColumnEClass, ICOLUMN__LENGTH); + createEAttribute(iColumnEClass, ICOLUMN__SPECIFIED_LENGTH); createEAttribute(iColumnEClass, ICOLUMN__PRECISION); + createEAttribute(iColumnEClass, ICOLUMN__SPECIFIED_PRECISION); createEAttribute(iColumnEClass, ICOLUMN__SCALE); + createEAttribute(iColumnEClass, ICOLUMN__SPECIFIED_SCALE); iColumnMappingEClass = createEClass(ICOLUMN_MAPPING); iBasicEClass = createEClass(IBASIC); createEAttribute(iBasicEClass, IBASIC__FETCH); @@ -6872,9 +6941,15 @@ public class JpaCoreMappingsPackage extends EPackageImpl initEAttribute(getIAbstractColumn_SpecifiedTable(), ecorePackage.getEString(), "specifiedTable", null, 0, 1, IAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getIAbstractColumn_DefaultTable(), ecorePackage.getEString(), "defaultTable", null, 0, 1, IAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(iColumnEClass, IColumn.class, "IColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIColumn_Length(), ecorePackage.getEInt(), "length", "255", 0, 1, IColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIColumn_Precision(), ecorePackage.getEInt(), "precision", null, 0, 1, IColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIColumn_Scale(), ecorePackage.getEInt(), "scale", null, 0, 1, IColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getIColumn_Length(), ecorePackage.getEInt(), "length", null, 0, 1, IColumn.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEAttribute(getIColumn_SpecifiedLength(), theEcorePackage.getEInt(), "specifiedLength", "-1", 0, 1, IColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getIColumn_Precision(), ecorePackage.getEInt(), "precision", null, 0, 1, IColumn.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEAttribute(getIColumn_SpecifiedPrecision(), theEcorePackage.getEInt(), "specifiedPrecision", "-1", 0, 1, IColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getIColumn_Scale(), ecorePackage.getEInt(), "scale", null, 0, 1, IColumn.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEAttribute(getIColumn_SpecifiedScale(), theEcorePackage.getEInt(), "specifiedScale", "-1", 0, 1, IColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + addEOperation(iColumnEClass, theEcorePackage.getEInt(), "getDefaultLength", 0, 1, IS_UNIQUE, IS_ORDERED); + addEOperation(iColumnEClass, theEcorePackage.getEInt(), "getDefaultPrecision", 0, 1, IS_UNIQUE, IS_ORDERED); + addEOperation(iColumnEClass, theEcorePackage.getEInt(), "getDefaultScale", 0, 1, IS_UNIQUE, IS_ORDERED); initEClass(iColumnMappingEClass, IColumnMapping.class, "IColumnMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); addEOperation(iColumnMappingEClass, this.getIColumn(), "getColumn", 0, 1, IS_UNIQUE, IS_ORDERED); initEClass(iBasicEClass, IBasic.class, "IBasic", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -7533,6 +7608,14 @@ public class JpaCoreMappingsPackage extends EPackageImpl public static final EAttribute ICOLUMN__LENGTH = eINSTANCE.getIColumn_Length(); /** + * The meta object literal for the '<em><b>Specified Length</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EAttribute ICOLUMN__SPECIFIED_LENGTH = eINSTANCE.getIColumn_SpecifiedLength(); + + /** * The meta object literal for the '<em><b>Precision</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -7541,6 +7624,14 @@ public class JpaCoreMappingsPackage extends EPackageImpl public static final EAttribute ICOLUMN__PRECISION = eINSTANCE.getIColumn_Precision(); /** + * The meta object literal for the '<em><b>Specified Precision</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EAttribute ICOLUMN__SPECIFIED_PRECISION = eINSTANCE.getIColumn_SpecifiedPrecision(); + + /** * The meta object literal for the '<em><b>Scale</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -7549,6 +7640,14 @@ public class JpaCoreMappingsPackage extends EPackageImpl public static final EAttribute ICOLUMN__SCALE = eINSTANCE.getIColumn_Scale(); /** + * The meta object literal for the '<em><b>Specified Scale</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EAttribute ICOLUMN__SPECIFIED_SCALE = eINSTANCE.getIColumn_SpecifiedScale(); + + /** * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IColumnMapping <em>IColumn Mapping</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/util/PersistenceAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/util/PersistenceAdapterFactory.java index a891e80d15..ba8ea5d668 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/util/PersistenceAdapterFactory.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/util/PersistenceAdapterFactory.java @@ -2,18 +2,21 @@ * <copyright> * </copyright> * - * $Id: PersistenceAdapterFactory.java,v 1.1 2007/07/30 20:13:47 pfullbright Exp $ + * $Id: PersistenceAdapterFactory.java,v 1.2 2007/08/21 16:19:36 kmoore Exp $ */ package org.eclipse.jpt.core.internal.resource.persistence.util; import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notifier; - import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; - import org.eclipse.emf.ecore.EObject; - -import org.eclipse.jpt.core.internal.resource.persistence.*; +import org.eclipse.jpt.core.internal.resource.persistence.JavaClassRef; +import org.eclipse.jpt.core.internal.resource.persistence.MappingFileRef; +import org.eclipse.jpt.core.internal.resource.persistence.Persistence; +import org.eclipse.jpt.core.internal.resource.persistence.PersistencePackage; +import org.eclipse.jpt.core.internal.resource.persistence.PersistenceUnit; +import org.eclipse.jpt.core.internal.resource.persistence.Properties; +import org.eclipse.jpt.core.internal.resource.persistence.Property; /** * <!-- begin-user-doc --> diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/util/PersistenceSwitch.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/util/PersistenceSwitch.java index 36a71f7019..27f0363221 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/util/PersistenceSwitch.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/util/PersistenceSwitch.java @@ -2,16 +2,20 @@ * <copyright> * </copyright> * - * $Id: PersistenceSwitch.java,v 1.1 2007/07/30 20:13:47 pfullbright Exp $ + * $Id: PersistenceSwitch.java,v 1.2 2007/08/21 16:19:36 kmoore Exp $ */ package org.eclipse.jpt.core.internal.resource.persistence.util; import java.util.List; - import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; - -import org.eclipse.jpt.core.internal.resource.persistence.*; +import org.eclipse.jpt.core.internal.resource.persistence.JavaClassRef; +import org.eclipse.jpt.core.internal.resource.persistence.MappingFileRef; +import org.eclipse.jpt.core.internal.resource.persistence.Persistence; +import org.eclipse.jpt.core.internal.resource.persistence.PersistencePackage; +import org.eclipse.jpt.core.internal.resource.persistence.PersistenceUnit; +import org.eclipse.jpt.core.internal.resource.persistence.Properties; +import org.eclipse.jpt.core.internal.resource.persistence.Property; /** * <!-- begin-user-doc --> |