|
Re: @Lob Causing incorrect Hibrenate mapping [message #985903 is a reply to message #985642] |
Fri, 16 November 2012 15:56 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Rob,
This is an omission in Teneo, I am solving it and will do a new build sometime today.
gr. Martin
On 11/15/2012 04:16 PM, Rob Mising name wrote:
> With an eCore that looks as follows:
>
>
> <eClassifiers xsi:type="ecore:EClass" name="Case1">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="Case1"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> <eAnnotations source="bds">
> <details key="isCase" value="true"/>
> </eAnnotations>
> <eAnnotations source="teneo.jpa">
> <details key="value" value="@Table(name="ROBTEST_CASE1")
> @DiscriminatorValue("com.example.robtest.Case1")"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="stringLob" unique="false" upperBound="-1">
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="stringLob"/>
> </eAnnotations>
> <eAnnotations source="teneo.jpa">
> <details key="value" value="@Lob
> @Column(name="STRINGLOB", length="1048576")"/>
> </eAnnotations>
> <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2003/XMLType#//String"/>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="bdsId">
> <eAnnotations source="teneo.jpa">
> <details key="value" value="@GeneratedValue(strategy="AUTO")
> @Id
> @Column(name="BDS_ID")"/>
> </eAnnotations>
> <eAnnotations source="bds">
> <details key="isId" value="true"/>
> </eAnnotations>
> <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//ELongObject"/>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="bdsVersion">
> <eAnnotations source="teneo.jpa">
> <details key="value" value="@Version
> @Column(name="BDS_VERSION")"/>
> </eAnnotations>
> <eAnnotations source="bds">
> <details key="isVersion" value="true"/>
> </eAnnotations>
> <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//ELongObject"/>
> </eStructuralFeatures>
> </eClassifiers>
>
>
> So the "stringLob" has the following annotation:
>
> Quote:
>> @Lob
>> @Column(name="STRINGLOB", length="1048576")
>
>
> If this is used to generate a hibernate mapping it gives:
>
> <hibernate-mapping auto-import="false">
> <class entity-name="robtest.Case1" abstract="false" lazy="false" discriminator-value="com.example.robtest.Case1"
> table="`BDS_1_ROBTEST_CASE1`">
> <meta attribute="eclassName">Case1</meta>
> <meta attribute="epackage">http://example.com/robtest</meta>
> <id name="bdsId" type="java.lang.Long">
> <column not-null="false" unique="false" name="`BDS_ID`"/>
> <generator class="native"/>
> </id>
> <discriminator column="`DTYPE`" type="string"/>
> <version name="bdsVersion" type="java.lang.Long">
> <column not-null="false" unique="false" name="`BDS_VERSION`"/>
> </version>
> <property name="stringLob" lazy="false" insert="true" update="true" not-null="false" unique="false" type="text">
> <column not-null="false" unique="false" name="`STRINGLOB`" length="1048576"/>
> </property>
> </class>
> </hibernate-mapping>
>
>
> But because the upperBound="-1" is specified, I would have expected it to generate a list for stringLob:
>
> <hibernate-mapping auto-import="false">
> <class entity-name="robtest.Case1" abstract="false" lazy="false" discriminator-value="com.example.robtest.Case1"
> table="`BDS_1_ROBTEST_CASE1`">
> <meta attribute="eclassName">Case1</meta>
> <meta attribute="epackage">http://example.com/robtest</meta>
> <id name="bdsId" type="java.lang.Long">
> <column not-null="false" unique="false" name="`BDS_ID`"/>
> <generator class="native"/>
> </id>
> <discriminator column="`DTYPE`" type="string"/>
> <version name="bdsVersion" type="java.lang.Long">
> <column not-null="false" unique="false" name="`BDS_VERSION`"/>
> </version>
> <list name="stringLob" table="`BDS_1_ROBTEST_CASE1STRINGLOB`" lazy="true" cascade="all,delete-orphan">
> <key update="true">
> <column name="`CASE1_STRINGLOB_BDSID`" not-null="true" unique="false"/>
> </key>
> <list-index column="`CASE1_STRINGLOB_IDX`"/>
> <element type="java.lang.String" not-null="false" unique="false" type="text">
> <column not-null="false" unique="false" name="`STRINGLOB`" length="1048576"/>
> </element>
> </list>
> <property name="stringLob" lazy="false" insert="true" update="true" not-null="false" unique="false" type="text">
> <column not-null="false" unique="false" name="`STRINGLOB`" length="1048576"/>
> </property>
> </class>
> </hibernate-mapping>
>
>
> Is anyone able to assist me with this, is it a know problem, or am I doing something wrong?
>
> Thanks
>
> Rob
>
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
Re: @Lob Causing incorrect Hibrenate mapping [message #985948 is a reply to message #985903] |
Fri, 16 November 2012 19:59 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Rob,
I published a new build which should solve this.
gr. Martin
On 11/16/2012 04:56 PM, Martin Taal wrote:
> Hi Rob,
> This is an omission in Teneo, I am solving it and will do a new build sometime today.
>
> gr. Martin
>
> On 11/15/2012 04:16 PM, Rob Mising name wrote:
>> With an eCore that looks as follows:
>>
>>
>> <eClassifiers xsi:type="ecore:EClass" name="Case1">
>> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="name" value="Case1"/>
>> <details key="kind" value="elementOnly"/>
>> </eAnnotations>
>> <eAnnotations source="bds">
>> <details key="isCase" value="true"/>
>> </eAnnotations>
>> <eAnnotations source="teneo.jpa">
>> <details key="value" value="@Table(name="ROBTEST_CASE1")
>> @DiscriminatorValue("com.example.robtest.Case1")"/>
>> </eAnnotations>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="stringLob" unique="false" upperBound="-1">
>> <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="stringLob"/>
>> </eAnnotations>
>> <eAnnotations source="teneo.jpa">
>> <details key="value" value="@Lob
>> @Column(name="STRINGLOB", length="1048576")"/>
>> </eAnnotations>
>> <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2003/XMLType#//String"/>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="bdsId">
>> <eAnnotations source="teneo.jpa">
>> <details key="value" value="@GeneratedValue(strategy="AUTO")
>> @Id
>> @Column(name="BDS_ID")"/>
>> </eAnnotations>
>> <eAnnotations source="bds">
>> <details key="isId" value="true"/>
>> </eAnnotations>
>> <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//ELongObject"/>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="bdsVersion">
>> <eAnnotations source="teneo.jpa">
>> <details key="value" value="@Version
>> @Column(name="BDS_VERSION")"/>
>> </eAnnotations>
>> <eAnnotations source="bds">
>> <details key="isVersion" value="true"/>
>> </eAnnotations>
>> <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//ELongObject"/>
>> </eStructuralFeatures>
>> </eClassifiers>
>>
>>
>> So the "stringLob" has the following annotation:
>>
>> Quote:
>>> @Lob
>>> @Column(name="STRINGLOB", length="1048576")
>>
>>
>> If this is used to generate a hibernate mapping it gives:
>>
>> <hibernate-mapping auto-import="false">
>> <class entity-name="robtest.Case1" abstract="false" lazy="false" discriminator-value="com.example.robtest.Case1"
>> table="`BDS_1_ROBTEST_CASE1`">
>> <meta attribute="eclassName">Case1</meta>
>> <meta attribute="epackage">http://example.com/robtest</meta>
>> <id name="bdsId" type="java.lang.Long">
>> <column not-null="false" unique="false" name="`BDS_ID`"/>
>> <generator class="native"/>
>> </id>
>> <discriminator column="`DTYPE`" type="string"/>
>> <version name="bdsVersion" type="java.lang.Long">
>> <column not-null="false" unique="false" name="`BDS_VERSION`"/>
>> </version>
>> <property name="stringLob" lazy="false" insert="true" update="true" not-null="false" unique="false" type="text">
>> <column not-null="false" unique="false" name="`STRINGLOB`" length="1048576"/>
>> </property>
>> </class>
>> </hibernate-mapping>
>>
>>
>> But because the upperBound="-1" is specified, I would have expected it to generate a list for stringLob:
>>
>> <hibernate-mapping auto-import="false">
>> <class entity-name="robtest.Case1" abstract="false" lazy="false" discriminator-value="com.example.robtest.Case1"
>> table="`BDS_1_ROBTEST_CASE1`">
>> <meta attribute="eclassName">Case1</meta>
>> <meta attribute="epackage">http://example.com/robtest</meta>
>> <id name="bdsId" type="java.lang.Long">
>> <column not-null="false" unique="false" name="`BDS_ID`"/>
>> <generator class="native"/>
>> </id>
>> <discriminator column="`DTYPE`" type="string"/>
>> <version name="bdsVersion" type="java.lang.Long">
>> <column not-null="false" unique="false" name="`BDS_VERSION`"/>
>> </version>
>> <list name="stringLob" table="`BDS_1_ROBTEST_CASE1STRINGLOB`" lazy="true" cascade="all,delete-orphan">
>> <key update="true">
>> <column name="`CASE1_STRINGLOB_BDSID`" not-null="true" unique="false"/>
>> </key>
>> <list-index column="`CASE1_STRINGLOB_IDX`"/>
>> <element type="java.lang.String" not-null="false" unique="false" type="text">
>> <column not-null="false" unique="false" name="`STRINGLOB`" length="1048576"/>
>> </element>
>> </list>
>> <property name="stringLob" lazy="false" insert="true" update="true" not-null="false" unique="false" type="text">
>> <column not-null="false" unique="false" name="`STRINGLOB`" length="1048576"/>
>> </property>
>> </class>
>> </hibernate-mapping>
>>
>>
>> Is anyone able to assist me with this, is it a know problem, or am I doing something wrong?
>>
>> Thanks
>>
>> Rob
>>
>>
>>
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03797 seconds