[420463] - implement columnDefinition handling for DiscriminatorColumn annotation
diff --git a/hibernate/org.eclipse.emf.teneo.hibernate.mapper/src/org/eclipse/emf/teneo/hibernate/mapper/EntityMapper.java b/hibernate/org.eclipse.emf.teneo.hibernate.mapper/src/org/eclipse/emf/teneo/hibernate/mapper/EntityMapper.java
index 8c81e03..1d7eef7 100755
--- a/hibernate/org.eclipse.emf.teneo.hibernate.mapper/src/org/eclipse/emf/teneo/hibernate/mapper/EntityMapper.java
+++ b/hibernate/org.eclipse.emf.teneo.hibernate.mapper/src/org/eclipse/emf/teneo/hibernate/mapper/EntityMapper.java
@@ -697,6 +697,9 @@
 			if (!col.isNullable()) {
 				colElement.addAttribute("not-null", "true");
 			}
+			if (col.getColumnDefinition() != null) {
+				colElement.addAttribute("sql-type", col.getColumnDefinition());
+			}
 		} else if (dColumn.getName() != null) {
 			dcElement.addAttribute("column", getHbmContext().trunc(dColumn, dColumn.getName()));
 		}
@@ -711,9 +714,17 @@
 		}
 
 		if (dColumn.getColumnDefinition() != null) {
-			log.error("Unsupported column definition in discriminator column " + dColumn);
-			throw new MappingException("Unsupported column definition in discriminator column", dColumn);
+			String colName = dcElement.getAttributeValue("column");
+			Element colElement = dcElement.element("column");
+			if (colElement == null) {
+				colElement = dcElement.addElement("column");
+				if (colName != null && colElement.getAttributeValue("name") == null) {
+					colElement.addAttribute("name", colName);
+				}
+			}
+			colElement.addAttribute("sql-type", dColumn.getColumnDefinition());
 		}
+
 		return dcElement;
 	}
 
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationAction_hsqldb_e_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationAction_hsqldb_e_o_hibernate.hbm.xml
index 1ab993a..d8a5952 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationAction_hsqldb_e_o_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationAction_hsqldb_e_o_hibernate.hbm.xml
@@ -74,7 +74,7 @@
 			<generator class="native"/>
 		</id>
 		<discriminator type="string">
-			<column name="`DISCRIMINATOR`" index="discrIndex,ohterindex" length="120"/>
+			<column name="`DISCRIMINATOR`" index="discrIndex,ohterindex" length="120" sql-type="character varying (100) "/>
 		</discriminator>
 		<version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler">
 			<meta attribute="syntheticVersion" inherit="false">true</meta>
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationAction_hsqldb_h_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationAction_hsqldb_h_o_hibernate.hbm.xml
index 6a914e5..d9da620 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationAction_hsqldb_h_o_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationAction_hsqldb_h_o_hibernate.hbm.xml
@@ -77,7 +77,7 @@
 			<generator class="native"/>
 		</id>
 		<discriminator type="string">
-			<column name="`DISCRIMINATOR`" index="discrIndex,ohterindex" length="120"/>
+			<column name="`DISCRIMINATOR`" index="discrIndex,ohterindex" length="120" sql-type="character varying (100) "/>
 		</discriminator>
 		<version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler">
 			<meta attribute="syntheticVersion" inherit="false">true</meta>
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationTablePerClassAction_hsqldb_e_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationTablePerClassAction_hsqldb_e_o_hibernate.hbm.xml
index 1ab993a..d8a5952 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationTablePerClassAction_hsqldb_e_o_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationTablePerClassAction_hsqldb_e_o_hibernate.hbm.xml
@@ -74,7 +74,7 @@
 			<generator class="native"/>
 		</id>
 		<discriminator type="string">
-			<column name="`DISCRIMINATOR`" index="discrIndex,ohterindex" length="120"/>
+			<column name="`DISCRIMINATOR`" index="discrIndex,ohterindex" length="120" sql-type="character varying (100) "/>
 		</discriminator>
 		<version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler">
 			<meta attribute="syntheticVersion" inherit="false">true</meta>
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationTablePerClassAction_hsqldb_h_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationTablePerClassAction_hsqldb_h_o_hibernate.hbm.xml
index 6a914e5..d9da620 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationTablePerClassAction_hsqldb_h_o_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/InheritanceAnnotationTablePerClassAction_hsqldb_h_o_hibernate.hbm.xml
@@ -77,7 +77,7 @@
 			<generator class="native"/>
 		</id>
 		<discriminator type="string">
-			<column name="`DISCRIMINATOR`" index="discrIndex,ohterindex" length="120"/>
+			<column name="`DISCRIMINATOR`" index="discrIndex,ohterindex" length="120" sql-type="character varying (100) "/>
 		</discriminator>
 		<version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler">
 			<meta attribute="syntheticVersion" inherit="false">true</meta>
diff --git a/tests/org.eclipse.emf.teneo.samples/plugin.xml b/tests/org.eclipse.emf.teneo.samples/plugin.xml
index 3cb83a3..23ed23c 100755
--- a/tests/org.eclipse.emf.teneo.samples/plugin.xml
+++ b/tests/org.eclipse.emf.teneo.samples/plugin.xml
@@ -37,4 +37,18 @@
             type="bz398161"
             class="org.eclipse.emf.teneo.samples.issues.bz398161.util.Bz398161ResourceFactoryImpl"/>
    </extension>
+   <extension point="org.eclipse.emf.ecore.generated_package">
+      <!-- @generated inheritancemapping -->
+      <package
+            uri="http://www.eclipse.org/emf/teneo/samples/emf/annotations/inheritancemapping"
+            class="org.eclipse.emf.teneo.samples.emf.annotations.inheritancemapping.InheritancemappingPackage"
+            genModel="src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/model/inheritancemapping.genmodel"/>
+   </extension>
+
+   <extension point="org.eclipse.emf.ecore.extension_parser">
+      <!-- @generated inheritancemapping -->
+      <parser
+            type="inheritancemapping"
+            class="org.eclipse.emf.teneo.samples.emf.annotations.inheritancemapping.util.InheritancemappingResourceFactoryImpl"/>
+   </extension>
 </plugin>
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/Price.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/Price.java
index 8198d5c..182fc00 100755
--- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/Price.java
+++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/Price.java
@@ -24,7 +24,7 @@
  * </p>
  *
  * @see org.eclipse.emf.teneo.samples.emf.annotations.inheritancemapping.InheritancemappingPackage#getPrice()
- * @model annotation="teneo.jpa appinfo='\n\t\t\t\t@Table(name=\"myprice\")\n\t\t\t\t@Inheritance(strategy=SINGLE_TABLE)\n\t\t\t\t@DiscriminatorColumn(name=\"DISCRIMINATOR\", discriminatorType=STRING, column=@Column(index=\"discrIndex,ohterindex\", length=120))\n\t\t\t\t@DiscriminatorValue(\"myPrice\")\n\t\t\t'"
+ * @model annotation="teneo.jpa appinfo='\t\t\t\t@Table(name=\"myprice\")\n\t\t\t\t@Inheritance(strategy=SINGLE_TABLE)\n\t\t\t\t@DiscriminatorColumn(name=\"DISCRIMINATOR\", discriminatorType=STRING, columnDefinition=\"character varying (100) \", column=@Column(index=\"discrIndex,ohterindex\", length=120))\n\t\t\t\t@DiscriminatorValue(\"myPrice\")\n\t\t\t'"
  *        extendedMetaData="name='Price' kind='elementOnly'"
  * @generated
  */
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/impl/InheritancemappingFactoryImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/impl/InheritancemappingFactoryImpl.java
index 5c6199c..a2b8999 100755
--- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/impl/InheritancemappingFactoryImpl.java
+++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/impl/InheritancemappingFactoryImpl.java
@@ -39,7 +39,7 @@
 	 */
 	public static InheritancemappingFactory init() {
 		try {
-			InheritancemappingFactory theInheritancemappingFactory = (InheritancemappingFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/emf/teneo/samples/emf/annotations/inheritancemapping"); 
+			InheritancemappingFactory theInheritancemappingFactory = (InheritancemappingFactory)EPackage.Registry.INSTANCE.getEFactory(InheritancemappingPackage.eNS_URI);
 			if (theInheritancemappingFactory != null) {
 				return theInheritancemappingFactory;
 			}
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/impl/InheritancemappingPackageImpl.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/impl/InheritancemappingPackageImpl.java
index 054579e..cb32747 100755
--- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/impl/InheritancemappingPackageImpl.java
+++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/impl/InheritancemappingPackageImpl.java
@@ -711,7 +711,7 @@
 		  (priceEClass, 
 		   source, 
 		   new String[] {
-			 "appinfo", "\n\t\t\t\t@Table(name=\"myprice\")\n\t\t\t\t@Inheritance(strategy=SINGLE_TABLE)\n\t\t\t\t@DiscriminatorColumn(name=\"DISCRIMINATOR\", discriminatorType=STRING, column=@Column(index=\"discrIndex,ohterindex\", length=120))\n\t\t\t\t@DiscriminatorValue(\"myPrice\")\n\t\t\t"
+			 "appinfo", "\t\t\t\t@Table(name=\"myprice\")\n\t\t\t\t@Inheritance(strategy=SINGLE_TABLE)\n\t\t\t\t@DiscriminatorColumn(name=\"DISCRIMINATOR\", discriminatorType=STRING, columnDefinition=\"character varying (100) \", column=@Column(index=\"discrIndex,ohterindex\", length=120))\n\t\t\t\t@DiscriminatorValue(\"myPrice\")\n\t\t\t"
 		   });								
 		addAnnotation
 		  (usAddressEClass, 
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/model/inheritancemapping.ecore b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/model/inheritancemapping.ecore
index 47178a4..3c5dcdc 100755
--- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/model/inheritancemapping.ecore
+++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/model/inheritancemapping.ecore
@@ -1,8 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
-    xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="inheritancemapping"
-    nsURI="http://www.eclipse.org/emf/teneo/samples/emf/annotations/inheritancemapping"
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="inheritancemapping" nsURI="http://www.eclipse.org/emf/teneo/samples/emf/annotations/inheritancemapping"
     nsPrefix="inheritancemapping">
   <eClassifiers xsi:type="ecore:EClass" name="Address" abstract="true">
     <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
@@ -99,7 +97,7 @@
   </eClassifiers>
   <eClassifiers xsi:type="ecore:EClass" name="Price">
     <eAnnotations source="teneo.jpa">
-      <details key="appinfo" value="&#xA;&#x9;&#x9;&#x9;&#x9;@Table(name=&quot;myprice&quot;)&#xA;&#x9;&#x9;&#x9;&#x9;@Inheritance(strategy=SINGLE_TABLE)&#xA;&#x9;&#x9;&#x9;&#x9;@DiscriminatorColumn(name=&quot;DISCRIMINATOR&quot;, discriminatorType=STRING, column=@Column(index=&quot;discrIndex,ohterindex&quot;, length=120))&#xA;&#x9;&#x9;&#x9;&#x9;@DiscriminatorValue(&quot;myPrice&quot;)&#xA;&#x9;&#x9;&#x9;"/>
+      <details key="appinfo" value="&#x9;&#x9;&#x9;&#x9;@Table(name=&quot;myprice&quot;)&#xA;&#x9;&#x9;&#x9;&#x9;@Inheritance(strategy=SINGLE_TABLE)&#xA;&#x9;&#x9;&#x9;&#x9;@DiscriminatorColumn(name=&quot;DISCRIMINATOR&quot;, discriminatorType=STRING, columnDefinition=&quot;character varying (100) &quot;, column=@Column(index=&quot;discrIndex,ohterindex&quot;, length=120))&#xA;&#x9;&#x9;&#x9;&#x9;@DiscriminatorValue(&quot;myPrice&quot;)&#xA;&#x9;&#x9;&#x9;"/>
     </eAnnotations>
     <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
       <details key="name" value="Price"/>
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/model/inheritancemapping.genmodel b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/model/inheritancemapping.genmodel
index 6b6edb9..e9061e2 100755
--- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/model/inheritancemapping.genmodel
+++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/model/inheritancemapping.genmodel
@@ -1,9 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
-    xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
-    xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.emf.teneo.samples/src"
-    modelPluginID="org.eclipse.emf.teneo.samples" modelName="inheritancemapping" importerID="org.eclipse.emf.importer.ecore"
-    complianceLevel="5.0">
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+    xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.emf.teneo.samples/src" modelPluginID="org.eclipse.emf.teneo.samples"
+    modelName="inheritancemapping" importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0">
   <foreignModel>inheritancemapping.ecore</foreignModel>
   <genPackages prefix="Inheritancemapping" basePackage="org.eclipse.emf.teneo.samples.emf.annotations"
       resource="XML" disposableProviderFactory="true" ecorePackage="inheritancemapping.ecore#/">
diff --git a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/util/InheritancemappingSwitch.java b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/util/InheritancemappingSwitch.java
index 0e3485d..63dcd9a 100755
--- a/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/util/InheritancemappingSwitch.java
+++ b/tests/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/inheritancemapping/util/InheritancemappingSwitch.java
@@ -11,6 +11,8 @@
 import org.eclipse.emf.ecore.EClass;
 import org.eclipse.emf.ecore.EObject;
 
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.util.Switch;
 import org.eclipse.emf.teneo.samples.emf.annotations.inheritancemapping.*;
 
 /**
@@ -26,7 +28,7 @@
  * @see org.eclipse.emf.teneo.samples.emf.annotations.inheritancemapping.InheritancemappingPackage
  * @generated
  */
-public class InheritancemappingSwitch<T> {
+public class InheritancemappingSwitch<T> extends Switch<T> {
 	/**
 	 * The cached model package
 	 * <!-- begin-user-doc -->
@@ -48,14 +50,16 @@
 	}
 
 	/**
-	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+	 * Checks whether this is a switch for the given package.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
-	 * @return the first non-null result returned by a <code>caseXXX</code> call.
+	 * @parameter ePackage the package in question.
+	 * @return whether this is a switch for the given package.
 	 * @generated
 	 */
-	public T doSwitch(EObject theEObject) {
-		return doSwitch(theEObject.eClass(), theEObject);
+	@Override
+	protected boolean isSwitchFor(EPackage ePackage) {
+		return ePackage == modelPackage;
 	}
 
 	/**
@@ -65,26 +69,7 @@
 	 * @return the first non-null result returned by a <code>caseXXX</code> call.
 	 * @generated
 	 */
-	protected T doSwitch(EClass theEClass, EObject theEObject) {
-		if (theEClass.eContainer() == modelPackage) {
-			return doSwitch(theEClass.getClassifierID(), theEObject);
-		}
-		else {
-			List<EClass> eSuperTypes = theEClass.getESuperTypes();
-			return
-				eSuperTypes.isEmpty() ?
-					defaultCase(theEObject) :
-					doSwitch(eSuperTypes.get(0), theEObject);
-		}
-	}
-
-	/**
-	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @return the first non-null result returned by a <code>caseXXX</code> call.
-	 * @generated
-	 */
+	@Override
 	protected T doSwitch(int classifierID, EObject theEObject) {
 		switch (classifierID) {
 			case InheritancemappingPackage.ADDRESS: {
@@ -383,6 +368,7 @@
 	 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
 	 * @generated
 	 */
+	@Override
 	public T defaultCase(EObject object) {
 		return null;
 	}