Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Problem with StringToStringMap and @Lob @Column Annotation
[Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #117298] Tue, 08 April 2008 20:09 Go to next message
Eclipse UserFriend
Originally posted by: schlamp.medihack.org

Hello.

I have a little problem when persisting an EMF StringToStringMap with
Teneo/Hibernate.
I defined the map as stated at
http://wiki.eclipse.org/EMF/FAQ#How_do_I_create_a_Map_in_EMF .3F
Everything works fine, but when I add the teneo.jpa annotation @Lob
@Column(length=100000) for the "value" field of the map, Teneo doesn't
create the table for this map anymore.
The above annotation works as exspected when used for other EMF class
fields (the table is created correctly and Derby uses CLOB instead of
VARCHAR). Only a StringToStringMap resp. any map has the problem not
accepting this annotation.

Another thing ... the naming scheme for maps seems to be a bit other than
for usual EMF objects.

Let's presume the model looks like below:

Document
|-properties:StringToStringMap
|-type:DocumentType (a ref to another EMF class)
|-content:String

Then Teneo/Hibernate creates the following tables (without specifying any
special naming via "@Column"): document, PROPERTIES, documenttype,
documentcontent.
Is there a reason why Hibernate names properties upper case and without
"document"?

Best regards,
Kai
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #117312 is a reply to message #117298] Tue, 08 April 2008 21:15 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Kai,
What exception do you get when trying out the lob and column annotation on the value member of the emap?
Can you post a small test model then I can try out what happens here? I checked the emap testcases I
have and they work fine. However, the current test case does not contain the @Lob and @Column
annotation for the value side.

Do you set any options when initializing the datastore?

gr. Martin

Kai Schlamp wrote:
> Hello.
>
> I have a little problem when persisting an EMF StringToStringMap with
> Teneo/Hibernate.
> I defined the map as stated at
> http://wiki.eclipse.org/EMF/FAQ#How_do_I_create_a_Map_in_EMF .3F
> Everything works fine, but when I add the teneo.jpa annotation @Lob
> @Column(length=100000) for the "value" field of the map, Teneo doesn't
> create the table for this map anymore.
> The above annotation works as exspected when used for other EMF class
> fields (the table is created correctly and Derby uses CLOB instead of
> VARCHAR). Only a StringToStringMap resp. any map has the problem not
> accepting this annotation.
>
> Another thing ... the naming scheme for maps seems to be a bit other
> than for usual EMF objects.
>
> Let's presume the model looks like below:
>
> Document
> |-properties:StringToStringMap
> |-type:DocumentType (a ref to another EMF class)
> |-content:String
>
> Then Teneo/Hibernate creates the following tables (without specifying
> any special naming via "@Column"): document, PROPERTIES, documenttype,
> documentcontent.
> Is there a reason why Hibernate names properties upper case and without
> "document"?
>
> Best regards,
> Kai
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #117708 is a reply to message #117312] Thu, 10 April 2008 21:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: schlamp.medihack.org

Hy, Martin.

> What exception do you get when trying out the lob and column annotation on
the value member of the emap?

My intention is to store large strings (up to one million characters).
Without specifying the @Lob and @Column(length=1000000) annotation for a
string attribute Teneo/Hibernate creates a VARCHAR length=255 database
field. This is a known problem with Derby, so the @Lob and @Column is a
workaround. With the help of those annotations, Hibernate creates CLOB
fields for those annotated string attributes. (See
http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)

> Can you post a small test model then I can try out what happens here? I
checked the emap testcases I
> have and they work fine. However, the current test case does not contain the
@Lob and @Column
> annotation for the value side.

Below my posting is the ecore and genmodel. It is a very simple test model
with only two classes. I use the @Lob and @Column annotation direct on a
string property and that works fine, Teneo/Hibernate creates a CLOB field
for this class attribute.
I also use the same annotation on the value attribute of the
StringToStringMap, but this time Teneo/Hibernate does simply not create
the appropriate table. When deleting the annotation of the value
attribute, the table for the map is created, but the value field is only
VARCHAR length=255 (as exspected).

> Do you set any options when initializing the datastore?

Nothing special:
hibernateProperties.setProperty(Environment.USER, username);
hibernateProperties.setProperty(Environment.PASS, password);
hibernateProperties.setProperty(Environment.DRIVER, driver);
hibernateProperties.setProperty(Environment.URL, url);
hibernateProperties.setProperty(Environment.DIALECT, dialect);

Thanks for the help,
Kai

Ecore ------------------------------------------------------------ -

<?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="testmodel"
nsURI="http://www.pubcurator.org/tester/testmodel"
nsPrefix="org.pubcurator.tester.testmodel">
<eClassifiers xsi:type="ecore:EClass" name="TestElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
upperBound="-1"
eType="#//StringToStringMap" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="testProp"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="teneo.jpa">
<details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
instanceClassName="java.util.Map$Entry">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="teneo.jpa">
<details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</ecore:EPackage>

Genmodel ----------------------------------------

<?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.pubcurator.tester.testmodel/src"
modelPluginID="org.pubcurator.tester.testmodel" modelName="Testmodel"
importerID="org.eclipse.emf.importer.ecore"
complianceLevel="6.0" copyrightFields="false">
<foreignModel>testmodel.ecore</foreignModel>
<genPackages prefix="TestModel" basePackage="org.pubcurator.tester"
disposableProviderFactory="true"
ecorePackage="testmodel.ecore#/">
<genClasses ecoreClass="testmodel.ecore#//TestElement">
<genFeatures property="None" children="true" createChild="true"
ecoreFeature="ecore:EReference testmodel.ecore#//TestElement/testMap"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute
testmodel.ecore#//TestElement/testProp"/>
</genClasses>
<genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute
testmodel.ecore#//StringToStringMap/key"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute
testmodel.ecore#//StringToStringMap/value"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #117734 is a reply to message #117708] Fri, 11 April 2008 03:13 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Kai,
I tested your ecore model and with me (and mysql) it seems to work fine, I get a mediumtext column.
The bibernatemapping also seems correct to me:
<map name="testMap" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`testelement_testmap_e_id`" not-null="false" unique="false"/>
</key>
<map-key type="java.lang.String"/>
<element type="text" not-null="false" unique="false">
<column not-null="false" unique="false" name="`value`" length="1000000"/>
</element>
</map>

Can you enable hibernate logging and check why the table is not created? My experience with
hibernate-mysql is that eventhough tables don't get created hibernate still continues, the sql error
is then displayed in the log.

gr. Martin

Kai Schlamp wrote:
> Hy, Martin.
>
>> What exception do you get when trying out the lob and column
>> annotation on
> the value member of the emap?
>
> My intention is to store large strings (up to one million characters).
> Without specifying the @Lob and @Column(length=1000000) annotation for a
> string attribute Teneo/Hibernate creates a VARCHAR length=255 database
> field. This is a known problem with Derby, so the @Lob and @Column is a
> workaround. With the help of those annotations, Hibernate creates CLOB
> fields for those annotated string attributes. (See
> http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)
>
>> Can you post a small test model then I can try out what happens here? I
> checked the emap testcases I
>> have and they work fine. However, the current test case does not
>> contain the
> @Lob and @Column
>> annotation for the value side.
>
> Below my posting is the ecore and genmodel. It is a very simple test
> model with only two classes. I use the @Lob and @Column annotation
> direct on a string property and that works fine, Teneo/Hibernate creates
> a CLOB field for this class attribute.
> I also use the same annotation on the value attribute of the
> StringToStringMap, but this time Teneo/Hibernate does simply not create
> the appropriate table. When deleting the annotation of the value
> attribute, the table for the map is created, but the value field is only
> VARCHAR length=255 (as exspected).
>
>> Do you set any options when initializing the datastore?
>
> Nothing special:
> hibernateProperties.setProperty(Environment.USER, username);
> hibernateProperties.setProperty(Environment.PASS, password);
> hibernateProperties.setProperty(Environment.DRIVER, driver);
> hibernateProperties.setProperty(Environment.URL, url);
> hibernateProperties.setProperty(Environment.DIALECT, dialect);
>
> Thanks for the help,
> Kai
>
> Ecore ------------------------------------------------------------ -
>
> <?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="testmodel"
> nsURI="http://www.pubcurator.org/tester/testmodel"
> nsPrefix="org.pubcurator.tester.testmodel">
> <eClassifiers xsi:type="ecore:EClass" name="TestElement">
> <eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
> upperBound="-1"
> eType="#//StringToStringMap" containment="true"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="testProp"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="teneo.jpa">
> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
> instanceClassName="java.util.Map$Entry">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="teneo.jpa">
> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> </ecore:EPackage>
>
> Genmodel ----------------------------------------
>
> <?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.pubcurator.tester.testmodel/src"
> modelPluginID="org.pubcurator.tester.testmodel" modelName="Testmodel"
> importerID="org.eclipse.emf.importer.ecore"
> complianceLevel="6.0" copyrightFields="false">
> <foreignModel>testmodel.ecore</foreignModel>
> <genPackages prefix="TestModel" basePackage="org.pubcurator.tester"
> disposableProviderFactory="true"
> ecorePackage="testmodel.ecore#/">
> <genClasses ecoreClass="testmodel.ecore#//TestElement">
> <genFeatures property="None" children="true" createChild="true"
> ecoreFeature="ecore:EReference testmodel.ecore#//TestElement/testMap"/>
> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
> testmodel.ecore#//TestElement/testProp"/>
> </genClasses>
> <genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
> testmodel.ecore#//StringToStringMap/key"/>
> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
> testmodel.ecore#//StringToStringMap/value"/>
> </genClasses>
> </genPackages>
> </genmodel:GenModel>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #120498 is a reply to message #117734] Mon, 28 April 2008 21:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: schlamp.medihack.org

Hello Martin,

sorry for the late reply ... I needed a little off time (for skiing and
fetching some sun :-)).
I tried to enable hibernate logging, but I can't get it to work :-(
I copied the log4j.properties file
(http://www.elver.org/hibernate/samples/log4j.properties) directly to the
src folder of my EMF model plugin. I also added log4j.properties to
bin.includes and src.includes of the build.properties.
I also tried to directly add org.apache.log4j as dependency for the emf
model plugin.
But no hibernate stuff appears on the console, nor on the "Error Log".
What else do I have to do? Add something to the source code?

Best regards,
Kai


Martin Taal wrote:

> Hi Kai,
> I tested your ecore model and with me (and mysql) it seems to work fine, I
get a mediumtext column.
> The bibernatemapping also seems correct to me:
> <map name="testMap" lazy="true" cascade="all,delete-orphan">
> <key update="true">
> <column name="`testelement_testmap_e_id`" not-null="false" unique="false"/>
> </key>
> <map-key type="java.lang.String"/>
> <element type="text" not-null="false" unique="false">
> <column not-null="false" unique="false" name="`value`" length="1000000"/>
> </element>
> </map>

> Can you enable hibernate logging and check why the table is not created? My
experience with
> hibernate-mysql is that eventhough tables don't get created hibernate still
continues, the sql error
> is then displayed in the log.

> gr. Martin

> Kai Schlamp wrote:
>> Hy, Martin.
>>
>>> What exception do you get when trying out the lob and column
>>> annotation on
>> the value member of the emap?
>>
>> My intention is to store large strings (up to one million characters).
>> Without specifying the @Lob and @Column(length=1000000) annotation for a
>> string attribute Teneo/Hibernate creates a VARCHAR length=255 database
>> field. This is a known problem with Derby, so the @Lob and @Column is a
>> workaround. With the help of those annotations, Hibernate creates CLOB
>> fields for those annotated string attributes. (See
>> http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)
>>
>>> Can you post a small test model then I can try out what happens here? I
>> checked the emap testcases I
>>> have and they work fine. However, the current test case does not
>>> contain the
>> @Lob and @Column
>>> annotation for the value side.
>>
>> Below my posting is the ecore and genmodel. It is a very simple test
>> model with only two classes. I use the @Lob and @Column annotation
>> direct on a string property and that works fine, Teneo/Hibernate creates
>> a CLOB field for this class attribute.
>> I also use the same annotation on the value attribute of the
>> StringToStringMap, but this time Teneo/Hibernate does simply not create
>> the appropriate table. When deleting the annotation of the value
>> attribute, the table for the map is created, but the value field is only
>> VARCHAR length=255 (as exspected).
>>
>>> Do you set any options when initializing the datastore?
>>
>> Nothing special:
>> hibernateProperties.setProperty(Environment.USER, username);
>> hibernateProperties.setProperty(Environment.PASS, password);
>> hibernateProperties.setProperty(Environment.DRIVER, driver);
>> hibernateProperties.setProperty(Environment.URL, url);
>> hibernateProperties.setProperty(Environment.DIALECT, dialect);
>>
>> Thanks for the help,
>> Kai
>>
>> Ecore ------------------------------------------------------------ -
>>
>> <?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="testmodel"
>> nsURI="http://www.pubcurator.org/tester/testmodel"
>> nsPrefix="org.pubcurator.tester.testmodel">
>> <eClassifiers xsi:type="ecore:EClass" name="TestElement">
>> <eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
>> upperBound="-1"
>> eType="#//StringToStringMap" containment="true"/>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="testProp"
>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>> <eAnnotations source="teneo.jpa">
>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
>> instanceClassName="java.util.Map$Entry">
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>> <eAnnotations source="teneo.jpa">
>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> </ecore:EPackage>
>>
>> Genmodel ----------------------------------------
>>
>> <?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.pubcurator.tester.testmodel/src"
>> modelPluginID="org.pubcurator.tester.testmodel" modelName="Testmodel"
>> importerID="org.eclipse.emf.importer.ecore"
>> complianceLevel="6.0" copyrightFields="false">
>> <foreignModel>testmodel.ecore</foreignModel>
>> <genPackages prefix="TestModel" basePackage="org.pubcurator.tester"
>> disposableProviderFactory="true"
>> ecorePackage="testmodel.ecore#/">
>> <genClasses ecoreClass="testmodel.ecore#//TestElement">
>> <genFeatures property="None" children="true" createChild="true"
>> ecoreFeature="ecore:EReference testmodel.ecore#//TestElement/testMap"/>
>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>> testmodel.ecore#//TestElement/testProp"/>
>> </genClasses>
>> <genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>> testmodel.ecore#//StringToStringMap/key"/>
>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>> testmodel.ecore#//StringToStringMap/value"/>
>> </genClasses>
>> </genPackages>
>> </genmodel:GenModel>
>>
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #120640 is a reply to message #120498] Tue, 29 April 2008 17:59 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Kai,
How do you run the program? I also find it difficult to get log4j working when running programs as
plugins within Eclipse. However when I run programs through static main methods or junit then log4j
output shows up.
I would also check the output folder (bin) to see if the log4j.properties is actually copied there.

gr. Martin

Kai Schlamp wrote:
> Hello Martin,
>
> sorry for the late reply ... I needed a little off time (for skiing and
> fetching some sun :-)).
> I tried to enable hibernate logging, but I can't get it to work :-(
> I copied the log4j.properties file
> (http://www.elver.org/hibernate/samples/log4j.properties) directly to
> the src folder of my EMF model plugin. I also added log4j.properties to
> bin.includes and src.includes of the build.properties.
> I also tried to directly add org.apache.log4j as dependency for the emf
> model plugin.
> But no hibernate stuff appears on the console, nor on the "Error Log".
> What else do I have to do? Add something to the source code?
>
> Best regards,
> Kai
>
>
> Martin Taal wrote:
>
>> Hi Kai,
>> I tested your ecore model and with me (and mysql) it seems to work
>> fine, I
> get a mediumtext column.
>> The bibernatemapping also seems correct to me:
>> <map name="testMap" lazy="true" cascade="all,delete-orphan">
>> <key update="true">
>> <column name="`testelement_testmap_e_id`" not-null="false"
>> unique="false"/>
>> </key>
>> <map-key type="java.lang.String"/>
>> <element type="text" not-null="false" unique="false">
>> <column not-null="false" unique="false" name="`value`"
>> length="1000000"/>
>> </element>
>> </map>
>
>> Can you enable hibernate logging and check why the table is not
>> created? My
> experience with
>> hibernate-mysql is that eventhough tables don't get created hibernate
>> still
> continues, the sql error
>> is then displayed in the log.
>
>> gr. Martin
>
>> Kai Schlamp wrote:
>>> Hy, Martin.
>>>
>>>> What exception do you get when trying out the lob and column
>>>> annotation on
>>> the value member of the emap?
>>>
>>> My intention is to store large strings (up to one million
>>> characters). Without specifying the @Lob and @Column(length=1000000)
>>> annotation for a string attribute Teneo/Hibernate creates a VARCHAR
>>> length=255 database field. This is a known problem with Derby, so the
>>> @Lob and @Column is a workaround. With the help of those annotations,
>>> Hibernate creates CLOB fields for those annotated string attributes.
>>> (See http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)
>>>
>>>> Can you post a small test model then I can try out what happens here? I
>>> checked the emap testcases I
>>>> have and they work fine. However, the current test case does not
>>>> contain the
>>> @Lob and @Column
>>>> annotation for the value side.
>>>
>>> Below my posting is the ecore and genmodel. It is a very simple test
>>> model with only two classes. I use the @Lob and @Column annotation
>>> direct on a string property and that works fine, Teneo/Hibernate
>>> creates a CLOB field for this class attribute.
>>> I also use the same annotation on the value attribute of the
>>> StringToStringMap, but this time Teneo/Hibernate does simply not
>>> create the appropriate table. When deleting the annotation of the
>>> value attribute, the table for the map is created, but the value
>>> field is only VARCHAR length=255 (as exspected).
>>>
>>>> Do you set any options when initializing the datastore?
>>>
>>> Nothing special:
>>> hibernateProperties.setProperty(Environment.USER, username);
>>> hibernateProperties.setProperty(Environment.PASS, password);
>>> hibernateProperties.setProperty(Environment.DRIVER, driver);
>>> hibernateProperties.setProperty(Environment.URL, url);
>>> hibernateProperties.setProperty(Environment.DIALECT, dialect);
>>>
>>> Thanks for the help,
>>> Kai
>>>
>>> Ecore ------------------------------------------------------------ -
>>>
>>> <?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="testmodel"
>>> nsURI="http://www.pubcurator.org/tester/testmodel"
>>> nsPrefix="org.pubcurator.tester.testmodel">
>>> <eClassifiers xsi:type="ecore:EClass" name="TestElement">
>>> <eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
>>> upperBound="-1"
>>> eType="#//StringToStringMap" containment="true"/>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="testProp"
>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> </eClassifiers>
>>> <eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
>>> instanceClassName="java.util.Map$Entry">
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>> eType="ecore:EDataType
>>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> </eClassifiers>
>>> </ecore:EPackage>
>>>
>>> Genmodel ----------------------------------------
>>>
>>> <?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.pubcurator.tester.testmodel/src"
>>> modelPluginID="org.pubcurator.tester.testmodel"
>>> modelName="Testmodel" importerID="org.eclipse.emf.importer.ecore"
>>> complianceLevel="6.0" copyrightFields="false">
>>> <foreignModel>testmodel.ecore</foreignModel>
>>> <genPackages prefix="TestModel" basePackage="org.pubcurator.tester"
>>> disposableProviderFactory="true"
>>> ecorePackage="testmodel.ecore#/">
>>> <genClasses ecoreClass="testmodel.ecore#//TestElement">
>>> <genFeatures property="None" children="true" createChild="true"
>>> ecoreFeature="ecore:EReference testmodel.ecore#//TestElement/testMap"/>
>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>> testmodel.ecore#//TestElement/testProp"/>
>>> </genClasses>
>>> <genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>> testmodel.ecore#//StringToStringMap/key"/>
>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>> testmodel.ecore#//StringToStringMap/value"/>
>>> </genClasses>
>>> </genPackages>
>>> </genmodel:GenModel>
>>>
>
>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #121574 is a reply to message #120640] Wed, 30 April 2008 21:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: schlamp.medihack.org

Hy Martin,

I managed getting log4j hibernate to work. I simply copied your
log4j.properties file as hibernate-log4j.properties in the
org.hibernate.eclipse_3.2.1.GA directory of the Eclipse hibernate plugin
(I use the plugin from here: http://www.hibernate.org/255.html).
Now everything is logged to the console, even if I run my application as
plugin within Eclipse (perhaps a good entry for your FAQ).

Ok, back to my main problem ... here is the interesting part from the log:
5053 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - create table
properties ("document_properties_id" bigint, "value" varchar(1000000), idx
varchar(255) not null, primary key ("document_properties_id", idx))
5081 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful:
create table properties ("document_properties_id" bigint, "value"
varchar(1000000), idx varchar(255) not null, primary key
("document_properties_id", idx))
5081 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - The length,
precision, or scale attribute for column, or type mapping
'VARCHAR(1000000)' is not valid.

As I stated in a previous post, "properties" is a attribute of "Document"
and is of type "StringToStringMap".
The "StringToStringMap" has a "key" and a "value" (both Strings).
"value" is annotated (the teneo.jpa way) with:
@Lob
@Column(length=1000000)

I would expect, that Hibernate uses not a VARCHAR, but a CLOB. It does
this correctly when adding the above annotation to an other attribute not
of a map type (e.g. a String attribute named "longtext" of "Document").

But it seems a bit that this this is a bug of hbm2ddl together with the
Derby dialect.
As I am already thinking about switching to HSQL, I hope that this won't
be a problem anymore then. I keep you updated, when I have done the switch.

I also have another little problem with bulk cascade delete, but I will
open a new thread for this.

Best regards,
Kai




Martin Taal wrote:

> Hi Kai,
> How do you run the program? I also find it difficult to get log4j working
when running programs as
> plugins within Eclipse. However when I run programs through static main
methods or junit then log4j
> output shows up.
> I would also check the output folder (bin) to see if the log4j.properties is
actually copied there.

> gr. Martin

> Kai Schlamp wrote:
>> Hello Martin,
>>
>> sorry for the late reply ... I needed a little off time (for skiing and
>> fetching some sun :-)).
>> I tried to enable hibernate logging, but I can't get it to work :-(
>> I copied the log4j.properties file
>> (http://www.elver.org/hibernate/samples/log4j.properties) directly to
>> the src folder of my EMF model plugin. I also added log4j.properties to
>> bin.includes and src.includes of the build.properties.
>> I also tried to directly add org.apache.log4j as dependency for the emf
>> model plugin.
>> But no hibernate stuff appears on the console, nor on the "Error Log".
>> What else do I have to do? Add something to the source code?
>>
>> Best regards,
>> Kai
>>
>>
>> Martin Taal wrote:
>>
>>> Hi Kai,
>>> I tested your ecore model and with me (and mysql) it seems to work
>>> fine, I
>> get a mediumtext column.
>>> The bibernatemapping also seems correct to me:
>>> <map name="testMap" lazy="true" cascade="all,delete-orphan">
>>> <key update="true">
>>> <column name="`testelement_testmap_e_id`" not-null="false"
>>> unique="false"/>
>>> </key>
>>> <map-key type="java.lang.String"/>
>>> <element type="text" not-null="false" unique="false">
>>> <column not-null="false" unique="false" name="`value`"
>>> length="1000000"/>
>>> </element>
>>> </map>
>>
>>> Can you enable hibernate logging and check why the table is not
>>> created? My
>> experience with
>>> hibernate-mysql is that eventhough tables don't get created hibernate
>>> still
>> continues, the sql error
>>> is then displayed in the log.
>>
>>> gr. Martin
>>
>>> Kai Schlamp wrote:
>>>> Hy, Martin.
>>>>
>>>>> What exception do you get when trying out the lob and column
>>>>> annotation on
>>>> the value member of the emap?
>>>>
>>>> My intention is to store large strings (up to one million
>>>> characters). Without specifying the @Lob and @Column(length=1000000)
>>>> annotation for a string attribute Teneo/Hibernate creates a VARCHAR
>>>> length=255 database field. This is a known problem with Derby, so the
>>>> @Lob and @Column is a workaround. With the help of those annotations,
>>>> Hibernate creates CLOB fields for those annotated string attributes.
>>>> (See http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)
>>>>
>>>>> Can you post a small test model then I can try out what happens here? I
>>>> checked the emap testcases I
>>>>> have and they work fine. However, the current test case does not
>>>>> contain the
>>>> @Lob and @Column
>>>>> annotation for the value side.
>>>>
>>>> Below my posting is the ecore and genmodel. It is a very simple test
>>>> model with only two classes. I use the @Lob and @Column annotation
>>>> direct on a string property and that works fine, Teneo/Hibernate
>>>> creates a CLOB field for this class attribute.
>>>> I also use the same annotation on the value attribute of the
>>>> StringToStringMap, but this time Teneo/Hibernate does simply not
>>>> create the appropriate table. When deleting the annotation of the
>>>> value attribute, the table for the map is created, but the value
>>>> field is only VARCHAR length=255 (as exspected).
>>>>
>>>>> Do you set any options when initializing the datastore?
>>>>
>>>> Nothing special:
>>>> hibernateProperties.setProperty(Environment.USER, username);
>>>> hibernateProperties.setProperty(Environment.PASS, password);
>>>> hibernateProperties.setProperty(Environment.DRIVER, driver);
>>>> hibernateProperties.setProperty(Environment.URL, url);
>>>> hibernateProperties.setProperty(Environment.DIALECT, dialect);
>>>>
>>>> Thanks for the help,
>>>> Kai
>>>>
>>>> Ecore ------------------------------------------------------------ -
>>>>
>>>> <?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="testmodel"
>>>> nsURI="http://www.pubcurator.org/tester/testmodel"
>>>> nsPrefix="org.pubcurator.tester.testmodel">
>>>> <eClassifiers xsi:type="ecore:EClass" name="TestElement">
>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
>>>> upperBound="-1"
>>>> eType="#//StringToStringMap" containment="true"/>
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="testProp"
>>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>>>> <eAnnotations source="teneo.jpa">
>>>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>>>> </eAnnotations>
>>>> </eStructuralFeatures>
>>>> </eClassifiers>
>>>> <eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
>>>> instanceClassName="java.util.Map$Entry">
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>>> eType="ecore:EDataType
>>>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>>>> <eAnnotations source="teneo.jpa">
>>>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>>>> </eAnnotations>
>>>> </eStructuralFeatures>
>>>> </eClassifiers>
>>>> </ecore:EPackage>
>>>>
>>>> Genmodel ----------------------------------------
>>>>
>>>> <?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.pubcurator.tester.testmodel/src"
>>>> modelPluginID="org.pubcurator.tester.testmodel"
>>>> modelName="Testmodel" importerID="org.eclipse.emf.importer.ecore"
>>>> complianceLevel="6.0" copyrightFields="false">
>>>> <foreignModel>testmodel.ecore</foreignModel>
>>>> <genPackages prefix="TestModel" basePackage="org.pubcurator.tester"
>>>> disposableProviderFactory="true"
>>>> ecorePackage="testmodel.ecore#/">
>>>> <genClasses ecoreClass="testmodel.ecore#//TestElement">
>>>> <genFeatures property="None" children="true" createChild="true"
>>>> ecoreFeature="ecore:EReference testmodel.ecore#//TestElement/testMap"/>
>>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>>> testmodel.ecore#//TestElement/testProp"/>
>>>> </genClasses>
>>>> <genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
>>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>>> testmodel.ecore#//StringToStringMap/key"/>
>>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>>> testmodel.ecore#//StringToStringMap/value"/>
>>>> </genClasses>
>>>> </genPackages>
>>>> </genmodel:GenModel>
>>>>
>>
>>
>>
>>
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #121611 is a reply to message #121574] Thu, 01 May 2008 12:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: schlamp.medihack.org

Ok, I tested the behavior with H2 database. The same thing here.
With the same annotation @Lob @Column(length=1000000000) Hibernate's
hbm2ddl one time creates a clob column for a String attribute of a normal
class and a other time tries to create a varchar column for a String
attribute of a StringToStringMap.
I am not really sure why this happens, but I simply avoid this problem now
by creating special string attributes for long strings, that are not
stored inside a StringToStringMap.

Kai

Kai Schlamp wrote:

> Hy Martin,

> I managed getting log4j hibernate to work. I simply copied your
> log4j.properties file as hibernate-log4j.properties in the
> org.hibernate.eclipse_3.2.1.GA directory of the Eclipse hibernate plugin
> (I use the plugin from here: http://www.hibernate.org/255.html).
> Now everything is logged to the console, even if I run my application as
> plugin within Eclipse (perhaps a good entry for your FAQ).

> Ok, back to my main problem ... here is the interesting part from the log:
> 5053 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - create table
> properties ("document_properties_id" bigint, "value" varchar(1000000), idx
> varchar(255) not null, primary key ("document_properties_id", idx))
> 5081 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful:
> create table properties ("document_properties_id" bigint, "value"
> varchar(1000000), idx varchar(255) not null, primary key
> ("document_properties_id", idx))
> 5081 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - The length,
> precision, or scale attribute for column, or type mapping
> 'VARCHAR(1000000)' is not valid.

> As I stated in a previous post, "properties" is a attribute of "Document"
> and is of type "StringToStringMap".
> The "StringToStringMap" has a "key" and a "value" (both Strings).
> "value" is annotated (the teneo.jpa way) with:
> @Lob
> @Column(length=1000000)

> I would expect, that Hibernate uses not a VARCHAR, but a CLOB. It does
> this correctly when adding the above annotation to an other attribute not
> of a map type (e.g. a String attribute named "longtext" of "Document").

> But it seems a bit that this this is a bug of hbm2ddl together with the
> Derby dialect.
> As I am already thinking about switching to HSQL, I hope that this won't
> be a problem anymore then. I keep you updated, when I have done the switch.

> I also have another little problem with bulk cascade delete, but I will
> open a new thread for this.

> Best regards,
> Kai




> Martin Taal wrote:

>> Hi Kai,
>> How do you run the program? I also find it difficult to get log4j working
> when running programs as
>> plugins within Eclipse. However when I run programs through static main
> methods or junit then log4j
>> output shows up.
>> I would also check the output folder (bin) to see if the log4j.properties
is
> actually copied there.

>> gr. Martin

>> Kai Schlamp wrote:
>>> Hello Martin,
>>>
>>> sorry for the late reply ... I needed a little off time (for skiing and
>>> fetching some sun :-)).
>>> I tried to enable hibernate logging, but I can't get it to work :-(
>>> I copied the log4j.properties file
>>> (http://www.elver.org/hibernate/samples/log4j.properties) directly to
>>> the src folder of my EMF model plugin. I also added log4j.properties to
>>> bin.includes and src.includes of the build.properties.
>>> I also tried to directly add org.apache.log4j as dependency for the emf
>>> model plugin.
>>> But no hibernate stuff appears on the console, nor on the "Error Log".
>>> What else do I have to do? Add something to the source code?
>>>
>>> Best regards,
>>> Kai
>>>
>>>
>>> Martin Taal wrote:
>>>
>>>> Hi Kai,
>>>> I tested your ecore model and with me (and mysql) it seems to work
>>>> fine, I
>>> get a mediumtext column.
>>>> The bibernatemapping also seems correct to me:
>>>> <map name="testMap" lazy="true" cascade="all,delete-orphan">
>>>> <key update="true">
>>>> <column name="`testelement_testmap_e_id`" not-null="false"
>>>> unique="false"/>
>>>> </key>
>>>> <map-key type="java.lang.String"/>
>>>> <element type="text" not-null="false" unique="false">
>>>> <column not-null="false" unique="false" name="`value`"
>>>> length="1000000"/>
>>>> </element>
>>>> </map>
>>>
>>>> Can you enable hibernate logging and check why the table is not
>>>> created? My
>>> experience with
>>>> hibernate-mysql is that eventhough tables don't get created hibernate
>>>> still
>>> continues, the sql error
>>>> is then displayed in the log.
>>>
>>>> gr. Martin
>>>
>>>> Kai Schlamp wrote:
>>>>> Hy, Martin.
>>>>>
>>>>>> What exception do you get when trying out the lob and column
>>>>>> annotation on
>>>>> the value member of the emap?
>>>>>
>>>>> My intention is to store large strings (up to one million
>>>>> characters). Without specifying the @Lob and @Column(length=1000000)
>>>>> annotation for a string attribute Teneo/Hibernate creates a VARCHAR
>>>>> length=255 database field. This is a known problem with Derby, so the
>>>>> @Lob and @Column is a workaround. With the help of those annotations,
>>>>> Hibernate creates CLOB fields for those annotated string attributes.
>>>>> (See http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)
>>>>>
>>>>>> Can you post a small test model then I can try out what happens here? I
>>>>> checked the emap testcases I
>>>>>> have and they work fine. However, the current test case does not
>>>>>> contain the
>>>>> @Lob and @Column
>>>>>> annotation for the value side.
>>>>>
>>>>> Below my posting is the ecore and genmodel. It is a very simple test
>>>>> model with only two classes. I use the @Lob and @Column annotation
>>>>> direct on a string property and that works fine, Teneo/Hibernate
>>>>> creates a CLOB field for this class attribute.
>>>>> I also use the same annotation on the value attribute of the
>>>>> StringToStringMap, but this time Teneo/Hibernate does simply not
>>>>> create the appropriate table. When deleting the annotation of the
>>>>> value attribute, the table for the map is created, but the value
>>>>> field is only VARCHAR length=255 (as exspected).
>>>>>
>>>>>> Do you set any options when initializing the datastore?
>>>>>
>>>>> Nothing special:
>>>>> hibernateProperties.setProperty(Environment.USER, username);
>>>>> hibernateProperties.setProperty(Environment.PASS, password);
>>>>> hibernateProperties.setProperty(Environment.DRIVER, driver);
>>>>> hibernateProperties.setProperty(Environment.URL, url);
>>>>> hibernateProperties.setProperty(Environment.DIALECT, dialect);
>>>>>
>>>>> Thanks for the help,
>>>>> Kai
>>>>>
>>>>> Ecore ------------------------------------------------------------ -
>>>>>
>>>>> <?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="testmodel"
>>>>> nsURI="http://www.pubcurator.org/tester/testmodel"
>>>>> nsPrefix="org.pubcurator.tester.testmodel">
>>>>> <eClassifiers xsi:type="ecore:EClass" name="TestElement">
>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
>>>>> upperBound="-1"
>>>>> eType="#//StringToStringMap" containment="true"/>
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="testProp"
>>>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>>>>> <eAnnotations source="teneo.jpa">
>>>>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>>>>> </eAnnotations>
>>>>> </eStructuralFeatures>
>>>>> </eClassifiers>
>>>>> <eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
>>>>> instanceClassName="java.util.Map$Entry">
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>>>> eType="ecore:EDataType
>>>>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>>>>> <eAnnotations source="teneo.jpa">
>>>>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>>>>> </eAnnotations>
>>>>> </eStructuralFeatures>
>>>>> </eClassifiers>
>>>>> </ecore:EPackage>
>>>>>
>>>>> Genmodel ----------------------------------------
>>>>>
>>>>> <?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.pubcurator.tester.testmodel/src"
>>>>> modelPluginID="org.pubcurator.tester.testmodel"
>>>>> modelName="Testmodel" importerID="org.eclipse.emf.importer.ecore"
>>>>> complianceLevel="6.0" copyrightFields="false">
>>>>> <foreignModel>testmodel.ecore</foreignModel>
>>>>> <genPackages prefix="TestModel" basePackage="org.pubcurator.tester"
>>>>> disposableProviderFactory="true"
>>>>> ecorePackage="testmodel.ecore#/">
>>>>> <genClasses ecoreClass="testmodel.ecore#//TestElement">
>>>>> <genFeatures property="None" children="true" createChild="true"
>>>>> ecoreFeature="ecore:EReference testmodel.ecore#//TestElement/testMap"/>
>>>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>>>> testmodel.ecore#//TestElement/testProp"/>
>>>>> </genClasses>
>>>>> <genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
>>>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>>>> testmodel.ecore#//StringToStringMap/key"/>
>>>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>>>> testmodel.ecore#//StringToStringMap/value"/>
>>>>> </genClasses>
>>>>> </genPackages>
>>>>> </genmodel:GenModel>
>>>>>
>>>
>>>
>>>
>>>
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #121721 is a reply to message #121611] Fri, 02 May 2008 05:32 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Kai,
How does the hibernate mapping of the map look like? Does Teneo set a type="text"?

gr. Martin

Kai Schlamp wrote:
> Ok, I tested the behavior with H2 database. The same thing here.
> With the same annotation @Lob @Column(length=1000000000) Hibernate's
> hbm2ddl one time creates a clob column for a String attribute of a
> normal class and a other time tries to create a varchar column for a
> String attribute of a StringToStringMap.
> I am not really sure why this happens, but I simply avoid this problem
> now by creating special string attributes for long strings, that are not
> stored inside a StringToStringMap.
>
> Kai
>
> Kai Schlamp wrote:
>
>> Hy Martin,
>
>> I managed getting log4j hibernate to work. I simply copied your
>> log4j.properties file as hibernate-log4j.properties in the
>> org.hibernate.eclipse_3.2.1.GA directory of the Eclipse hibernate
>> plugin (I use the plugin from here: http://www.hibernate.org/255.html).
>> Now everything is logged to the console, even if I run my application
>> as plugin within Eclipse (perhaps a good entry for your FAQ).
>
>> Ok, back to my main problem ... here is the interesting part from the
>> log:
>> 5053 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - create
>> table properties ("document_properties_id" bigint, "value"
>> varchar(1000000), idx varchar(255) not null, primary key
>> ("document_properties_id", idx))
>> 5081 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate -
>> Unsuccessful: create table properties ("document_properties_id"
>> bigint, "value" varchar(1000000), idx varchar(255) not null, primary
>> key ("document_properties_id", idx))
>> 5081 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - The
>> length, precision, or scale attribute for column, or type mapping
>> 'VARCHAR(1000000)' is not valid.
>
>> As I stated in a previous post, "properties" is a attribute of
>> "Document" and is of type "StringToStringMap".
>> The "StringToStringMap" has a "key" and a "value" (both Strings).
>> "value" is annotated (the teneo.jpa way) with:
>> @Lob
>> @Column(length=1000000)
>
>> I would expect, that Hibernate uses not a VARCHAR, but a CLOB. It does
>> this correctly when adding the above annotation to an other attribute
>> not of a map type (e.g. a String attribute named "longtext" of
>> "Document").
>
>> But it seems a bit that this this is a bug of hbm2ddl together with
>> the Derby dialect.
>> As I am already thinking about switching to HSQL, I hope that this
>> won't be a problem anymore then. I keep you updated, when I have done
>> the switch.
>
>> I also have another little problem with bulk cascade delete, but I
>> will open a new thread for this.
>
>> Best regards,
>> Kai
>
>
>
>
>> Martin Taal wrote:
>
>>> Hi Kai,
>>> How do you run the program? I also find it difficult to get log4j
>>> working
>> when running programs as
>>> plugins within Eclipse. However when I run programs through static main
>> methods or junit then log4j
>>> output shows up.
>>> I would also check the output folder (bin) to see if the
>>> log4j.properties
> is
>> actually copied there.
>
>>> gr. Martin
>
>>> Kai Schlamp wrote:
>>>> Hello Martin,
>>>>
>>>> sorry for the late reply ... I needed a little off time (for skiing
>>>> and fetching some sun :-)).
>>>> I tried to enable hibernate logging, but I can't get it to work :-(
>>>> I copied the log4j.properties file
>>>> (http://www.elver.org/hibernate/samples/log4j.properties) directly
>>>> to the src folder of my EMF model plugin. I also added
>>>> log4j.properties to bin.includes and src.includes of the
>>>> build.properties.
>>>> I also tried to directly add org.apache.log4j as dependency for the
>>>> emf model plugin.
>>>> But no hibernate stuff appears on the console, nor on the "Error Log".
>>>> What else do I have to do? Add something to the source code?
>>>>
>>>> Best regards,
>>>> Kai
>>>>
>>>>
>>>> Martin Taal wrote:
>>>>
>>>>> Hi Kai,
>>>>> I tested your ecore model and with me (and mysql) it seems to work
>>>>> fine, I
>>>> get a mediumtext column.
>>>>> The bibernatemapping also seems correct to me:
>>>>> <map name="testMap" lazy="true" cascade="all,delete-orphan">
>>>>> <key update="true">
>>>>> <column name="`testelement_testmap_e_id`" not-null="false"
>>>>> unique="false"/>
>>>>> </key>
>>>>> <map-key type="java.lang.String"/>
>>>>> <element type="text" not-null="false" unique="false">
>>>>> <column not-null="false" unique="false" name="`value`"
>>>>> length="1000000"/>
>>>>> </element>
>>>>> </map>
>>>>
>>>>> Can you enable hibernate logging and check why the table is not
>>>>> created? My
>>>> experience with
>>>>> hibernate-mysql is that eventhough tables don't get created
>>>>> hibernate still
>>>> continues, the sql error
>>>>> is then displayed in the log.
>>>>
>>>>> gr. Martin
>>>>
>>>>> Kai Schlamp wrote:
>>>>>> Hy, Martin.
>>>>>>
>>>>>>> What exception do you get when trying out the lob and column
>>>>>>> annotation on
>>>>>> the value member of the emap?
>>>>>>
>>>>>> My intention is to store large strings (up to one million
>>>>>> characters). Without specifying the @Lob and
>>>>>> @Column(length=1000000) annotation for a string attribute
>>>>>> Teneo/Hibernate creates a VARCHAR length=255 database field. This
>>>>>> is a known problem with Derby, so the @Lob and @Column is a
>>>>>> workaround. With the help of those annotations, Hibernate creates
>>>>>> CLOB fields for those annotated string attributes. (See
>>>>>> http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)
>>>>>>
>>>>>>> Can you post a small test model then I can try out what happens
>>>>>>> here? I
>>>>>> checked the emap testcases I
>>>>>>> have and they work fine. However, the current test case does not
>>>>>>> contain the
>>>>>> @Lob and @Column
>>>>>>> annotation for the value side.
>>>>>>
>>>>>> Below my posting is the ecore and genmodel. It is a very simple
>>>>>> test model with only two classes. I use the @Lob and @Column
>>>>>> annotation direct on a string property and that works fine,
>>>>>> Teneo/Hibernate creates a CLOB field for this class attribute.
>>>>>> I also use the same annotation on the value attribute of the
>>>>>> StringToStringMap, but this time Teneo/Hibernate does simply not
>>>>>> create the appropriate table. When deleting the annotation of the
>>>>>> value attribute, the table for the map is created, but the value
>>>>>> field is only VARCHAR length=255 (as exspected).
>>>>>>
>>>>>>> Do you set any options when initializing the datastore?
>>>>>>
>>>>>> Nothing special:
>>>>>> hibernateProperties.setProperty(Environment.USER, username);
>>>>>> hibernateProperties.setProperty(Environment.PASS, password);
>>>>>> hibernateProperties.setProperty(Environment.DRIVER, driver);
>>>>>> hibernateProperties.setProperty(Environment.URL, url);
>>>>>> hibernateProperties.setProperty(Environment.DIALECT, dialect);
>>>>>>
>>>>>> Thanks for the help,
>>>>>> Kai
>>>>>>
>>>>>> Ecore ------------------------------------------------------------ -
>>>>>>
>>>>>> <?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="testmodel"
>>>>>> nsURI="http://www.pubcurator.org/tester/testmodel"
>>>>>> nsPrefix="org.pubcurator.tester.testmodel">
>>>>>> <eClassifiers xsi:type="ecore:EClass" name="TestElement">
>>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
>>>>>> upperBound="-1"
>>>>>> eType="#//StringToStringMap" containment="true"/>
>>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute"
>>>>>> name="testProp" eType="ecore:EDataType
>>>>>> http://www.eclipse.org/emf/2002/Ecore#//EString">
>>>>>> <eAnnotations source="teneo.jpa">
>>>>>> <details key="value"
>>>>>> value="@Lob&#xA;@Column(length=1000000)"/>
>>>>>> </eAnnotations>
>>>>>> </eStructuralFeatures>
>>>>>> </eClassifiers>
>>>>>> <eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
>>>>>> instanceClassName="java.util.Map$Entry">
>>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>>>>> eType="ecore:EDataType
>>>>>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>>>>> eType="ecore:EDataType
>>>>>> http://www.eclipse.org/emf/2002/Ecore#//EString">
>>>>>> <eAnnotations source="teneo.jpa">
>>>>>> <details key="value"
>>>>>> value="@Lob&#xA;@Column(length=1000000)"/>
>>>>>> </eAnnotations>
>>>>>> </eStructuralFeatures>
>>>>>> </eClassifiers>
>>>>>> </ecore:EPackage>
>>>>>>
>>>>>> Genmodel ----------------------------------------
>>>>>>
>>>>>> <?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.pubcurator.tester.testmodel/src"
>>>>>> modelPluginID="org.pubcurator.tester.testmodel"
>>>>>> modelName="Testmodel" importerID="org.eclipse.emf.importer.ecore"
>>>>>> complianceLevel="6.0" copyrightFields="false">
>>>>>> <foreignModel>testmodel.ecore</foreignModel>
>>>>>> <genPackages prefix="TestModel"
>>>>>> basePackage="org.pubcurator.tester" disposableProviderFactory="true"
>>>>>> ecorePackage="testmodel.ecore#/">
>>>>>> <genClasses ecoreClass="testmodel.ecore#//TestElement">
>>>>>> <genFeatures property="None" children="true"
>>>>>> createChild="true" ecoreFeature="ecore:EReference
>>>>>> testmodel.ecore#//TestElement/testMap"/>
>>>>>> <genFeatures createChild="false"
>>>>>> ecoreFeature="ecore:EAttribute
>>>>>> testmodel.ecore#//TestElement/testProp"/>
>>>>>> </genClasses>
>>>>>> <genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
>>>>>> <genFeatures createChild="false"
>>>>>> ecoreFeature="ecore:EAttribute
>>>>>> testmodel.ecore#//StringToStringMap/key"/>
>>>>>> <genFeatures createChild="false"
>>>>>> ecoreFeature="ecore:EAttribute
>>>>>> testmodel.ecore#//StringToStringMap/value"/>
>>>>>> </genClasses>
>>>>>> </genPackages>
>>>>>> </genmodel:GenModel>
>>>>>>
>>>>
>>>>
>>>>
>>>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #616111 is a reply to message #117298] Tue, 08 April 2008 21:15 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Kai,
What exception do you get when trying out the lob and column annotation on the value member of the emap?
Can you post a small test model then I can try out what happens here? I checked the emap testcases I
have and they work fine. However, the current test case does not contain the @Lob and @Column
annotation for the value side.

Do you set any options when initializing the datastore?

gr. Martin

Kai Schlamp wrote:
> Hello.
>
> I have a little problem when persisting an EMF StringToStringMap with
> Teneo/Hibernate.
> I defined the map as stated at
> http://wiki.eclipse.org/EMF/FAQ#How_do_I_create_a_Map_in_EMF .3F
> Everything works fine, but when I add the teneo.jpa annotation @Lob
> @Column(length=100000) for the "value" field of the map, Teneo doesn't
> create the table for this map anymore.
> The above annotation works as exspected when used for other EMF class
> fields (the table is created correctly and Derby uses CLOB instead of
> VARCHAR). Only a StringToStringMap resp. any map has the problem not
> accepting this annotation.
>
> Another thing ... the naming scheme for maps seems to be a bit other
> than for usual EMF objects.
>
> Let's presume the model looks like below:
>
> Document
> |-properties:StringToStringMap
> |-type:DocumentType (a ref to another EMF class)
> |-content:String
>
> Then Teneo/Hibernate creates the following tables (without specifying
> any special naming via "@Column"): document, PROPERTIES, documenttype,
> documentcontent.
> Is there a reason why Hibernate names properties upper case and without
> "document"?
>
> Best regards,
> Kai
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #616190 is a reply to message #117312] Thu, 10 April 2008 21:18 Go to previous message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Hy, Martin.

> What exception do you get when trying out the lob and column annotation on
the value member of the emap?

My intention is to store large strings (up to one million characters).
Without specifying the @Lob and @Column(length=1000000) annotation for a
string attribute Teneo/Hibernate creates a VARCHAR length=255 database
field. This is a known problem with Derby, so the @Lob and @Column is a
workaround. With the help of those annotations, Hibernate creates CLOB
fields for those annotated string attributes. (See
http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)

> Can you post a small test model then I can try out what happens here? I
checked the emap testcases I
> have and they work fine. However, the current test case does not contain the
@Lob and @Column
> annotation for the value side.

Below my posting is the ecore and genmodel. It is a very simple test model
with only two classes. I use the @Lob and @Column annotation direct on a
string property and that works fine, Teneo/Hibernate creates a CLOB field
for this class attribute.
I also use the same annotation on the value attribute of the
StringToStringMap, but this time Teneo/Hibernate does simply not create
the appropriate table. When deleting the annotation of the value
attribute, the table for the map is created, but the value field is only
VARCHAR length=255 (as exspected).

> Do you set any options when initializing the datastore?

Nothing special:
hibernateProperties.setProperty(Environment.USER, username);
hibernateProperties.setProperty(Environment.PASS, password);
hibernateProperties.setProperty(Environment.DRIVER, driver);
hibernateProperties.setProperty(Environment.URL, url);
hibernateProperties.setProperty(Environment.DIALECT, dialect);

Thanks for the help,
Kai

Ecore ------------------------------------------------------------ -

<?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="testmodel"
nsURI="http://www.pubcurator.org/tester/testmodel"
nsPrefix="org.pubcurator.tester.testmodel">
<eClassifiers xsi:type="ecore:EClass" name="TestElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
upperBound="-1"
eType="#//StringToStringMap" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="testProp"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="teneo.jpa">
<details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
instanceClassName="java.util.Map$Entry">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="teneo.jpa">
<details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</ecore:EPackage>

Genmodel ----------------------------------------

<?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.pubcurator.tester.testmodel/src"
modelPluginID="org.pubcurator.tester.testmodel" modelName="Testmodel"
importerID="org.eclipse.emf.importer.ecore"
complianceLevel="6.0" copyrightFields="false">
<foreignModel>testmodel.ecore</foreignModel>
<genPackages prefix="TestModel" basePackage="org.pubcurator.tester"
disposableProviderFactory="true"
ecorePackage="testmodel.ecore#/">
<genClasses ecoreClass="testmodel.ecore#//TestElement">
<genFeatures property="None" children="true" createChild="true"
ecoreFeature="ecore:EReference testmodel.ecore#//TestElement/testMap"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute
testmodel.ecore#//TestElement/testProp"/>
</genClasses>
<genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute
testmodel.ecore#//StringToStringMap/key"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute
testmodel.ecore#//StringToStringMap/value"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #616194 is a reply to message #117708] Fri, 11 April 2008 03:13 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Kai,
I tested your ecore model and with me (and mysql) it seems to work fine, I get a mediumtext column.
The bibernatemapping also seems correct to me:
<map name="testMap" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`testelement_testmap_e_id`" not-null="false" unique="false"/>
</key>
<map-key type="java.lang.String"/>
<element type="text" not-null="false" unique="false">
<column not-null="false" unique="false" name="`value`" length="1000000"/>
</element>
</map>

Can you enable hibernate logging and check why the table is not created? My experience with
hibernate-mysql is that eventhough tables don't get created hibernate still continues, the sql error
is then displayed in the log.

gr. Martin

Kai Schlamp wrote:
> Hy, Martin.
>
>> What exception do you get when trying out the lob and column
>> annotation on
> the value member of the emap?
>
> My intention is to store large strings (up to one million characters).
> Without specifying the @Lob and @Column(length=1000000) annotation for a
> string attribute Teneo/Hibernate creates a VARCHAR length=255 database
> field. This is a known problem with Derby, so the @Lob and @Column is a
> workaround. With the help of those annotations, Hibernate creates CLOB
> fields for those annotated string attributes. (See
> http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)
>
>> Can you post a small test model then I can try out what happens here? I
> checked the emap testcases I
>> have and they work fine. However, the current test case does not
>> contain the
> @Lob and @Column
>> annotation for the value side.
>
> Below my posting is the ecore and genmodel. It is a very simple test
> model with only two classes. I use the @Lob and @Column annotation
> direct on a string property and that works fine, Teneo/Hibernate creates
> a CLOB field for this class attribute.
> I also use the same annotation on the value attribute of the
> StringToStringMap, but this time Teneo/Hibernate does simply not create
> the appropriate table. When deleting the annotation of the value
> attribute, the table for the map is created, but the value field is only
> VARCHAR length=255 (as exspected).
>
>> Do you set any options when initializing the datastore?
>
> Nothing special:
> hibernateProperties.setProperty(Environment.USER, username);
> hibernateProperties.setProperty(Environment.PASS, password);
> hibernateProperties.setProperty(Environment.DRIVER, driver);
> hibernateProperties.setProperty(Environment.URL, url);
> hibernateProperties.setProperty(Environment.DIALECT, dialect);
>
> Thanks for the help,
> Kai
>
> Ecore ------------------------------------------------------------ -
>
> <?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="testmodel"
> nsURI="http://www.pubcurator.org/tester/testmodel"
> nsPrefix="org.pubcurator.tester.testmodel">
> <eClassifiers xsi:type="ecore:EClass" name="TestElement">
> <eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
> upperBound="-1"
> eType="#//StringToStringMap" containment="true"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="testProp"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="teneo.jpa">
> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
> instanceClassName="java.util.Map$Entry">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="teneo.jpa">
> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> </ecore:EPackage>
>
> Genmodel ----------------------------------------
>
> <?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.pubcurator.tester.testmodel/src"
> modelPluginID="org.pubcurator.tester.testmodel" modelName="Testmodel"
> importerID="org.eclipse.emf.importer.ecore"
> complianceLevel="6.0" copyrightFields="false">
> <foreignModel>testmodel.ecore</foreignModel>
> <genPackages prefix="TestModel" basePackage="org.pubcurator.tester"
> disposableProviderFactory="true"
> ecorePackage="testmodel.ecore#/">
> <genClasses ecoreClass="testmodel.ecore#//TestElement">
> <genFeatures property="None" children="true" createChild="true"
> ecoreFeature="ecore:EReference testmodel.ecore#//TestElement/testMap"/>
> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
> testmodel.ecore#//TestElement/testProp"/>
> </genClasses>
> <genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
> testmodel.ecore#//StringToStringMap/key"/>
> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
> testmodel.ecore#//StringToStringMap/value"/>
> </genClasses>
> </genPackages>
> </genmodel:GenModel>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #617944 is a reply to message #117734] Mon, 28 April 2008 21:39 Go to previous message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Hello Martin,

sorry for the late reply ... I needed a little off time (for skiing and
fetching some sun :-)).
I tried to enable hibernate logging, but I can't get it to work :-(
I copied the log4j.properties file
(http://www.elver.org/hibernate/samples/log4j.properties) directly to the
src folder of my EMF model plugin. I also added log4j.properties to
bin.includes and src.includes of the build.properties.
I also tried to directly add org.apache.log4j as dependency for the emf
model plugin.
But no hibernate stuff appears on the console, nor on the "Error Log".
What else do I have to do? Add something to the source code?

Best regards,
Kai


Martin Taal wrote:

> Hi Kai,
> I tested your ecore model and with me (and mysql) it seems to work fine, I
get a mediumtext column.
> The bibernatemapping also seems correct to me:
> <map name="testMap" lazy="true" cascade="all,delete-orphan">
> <key update="true">
> <column name="`testelement_testmap_e_id`" not-null="false" unique="false"/>
> </key>
> <map-key type="java.lang.String"/>
> <element type="text" not-null="false" unique="false">
> <column not-null="false" unique="false" name="`value`" length="1000000"/>
> </element>
> </map>

> Can you enable hibernate logging and check why the table is not created? My
experience with
> hibernate-mysql is that eventhough tables don't get created hibernate still
continues, the sql error
> is then displayed in the log.

> gr. Martin

> Kai Schlamp wrote:
>> Hy, Martin.
>>
>>> What exception do you get when trying out the lob and column
>>> annotation on
>> the value member of the emap?
>>
>> My intention is to store large strings (up to one million characters).
>> Without specifying the @Lob and @Column(length=1000000) annotation for a
>> string attribute Teneo/Hibernate creates a VARCHAR length=255 database
>> field. This is a known problem with Derby, so the @Lob and @Column is a
>> workaround. With the help of those annotations, Hibernate creates CLOB
>> fields for those annotated string attributes. (See
>> http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)
>>
>>> Can you post a small test model then I can try out what happens here? I
>> checked the emap testcases I
>>> have and they work fine. However, the current test case does not
>>> contain the
>> @Lob and @Column
>>> annotation for the value side.
>>
>> Below my posting is the ecore and genmodel. It is a very simple test
>> model with only two classes. I use the @Lob and @Column annotation
>> direct on a string property and that works fine, Teneo/Hibernate creates
>> a CLOB field for this class attribute.
>> I also use the same annotation on the value attribute of the
>> StringToStringMap, but this time Teneo/Hibernate does simply not create
>> the appropriate table. When deleting the annotation of the value
>> attribute, the table for the map is created, but the value field is only
>> VARCHAR length=255 (as exspected).
>>
>>> Do you set any options when initializing the datastore?
>>
>> Nothing special:
>> hibernateProperties.setProperty(Environment.USER, username);
>> hibernateProperties.setProperty(Environment.PASS, password);
>> hibernateProperties.setProperty(Environment.DRIVER, driver);
>> hibernateProperties.setProperty(Environment.URL, url);
>> hibernateProperties.setProperty(Environment.DIALECT, dialect);
>>
>> Thanks for the help,
>> Kai
>>
>> Ecore ------------------------------------------------------------ -
>>
>> <?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="testmodel"
>> nsURI="http://www.pubcurator.org/tester/testmodel"
>> nsPrefix="org.pubcurator.tester.testmodel">
>> <eClassifiers xsi:type="ecore:EClass" name="TestElement">
>> <eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
>> upperBound="-1"
>> eType="#//StringToStringMap" containment="true"/>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="testProp"
>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>> <eAnnotations source="teneo.jpa">
>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
>> instanceClassName="java.util.Map$Entry">
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>> <eAnnotations source="teneo.jpa">
>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> </ecore:EPackage>
>>
>> Genmodel ----------------------------------------
>>
>> <?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.pubcurator.tester.testmodel/src"
>> modelPluginID="org.pubcurator.tester.testmodel" modelName="Testmodel"
>> importerID="org.eclipse.emf.importer.ecore"
>> complianceLevel="6.0" copyrightFields="false">
>> <foreignModel>testmodel.ecore</foreignModel>
>> <genPackages prefix="TestModel" basePackage="org.pubcurator.tester"
>> disposableProviderFactory="true"
>> ecorePackage="testmodel.ecore#/">
>> <genClasses ecoreClass="testmodel.ecore#//TestElement">
>> <genFeatures property="None" children="true" createChild="true"
>> ecoreFeature="ecore:EReference testmodel.ecore#//TestElement/testMap"/>
>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>> testmodel.ecore#//TestElement/testProp"/>
>> </genClasses>
>> <genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>> testmodel.ecore#//StringToStringMap/key"/>
>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>> testmodel.ecore#//StringToStringMap/value"/>
>> </genClasses>
>> </genPackages>
>> </genmodel:GenModel>
>>
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #617954 is a reply to message #120498] Tue, 29 April 2008 17:59 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Kai,
How do you run the program? I also find it difficult to get log4j working when running programs as
plugins within Eclipse. However when I run programs through static main methods or junit then log4j
output shows up.
I would also check the output folder (bin) to see if the log4j.properties is actually copied there.

gr. Martin

Kai Schlamp wrote:
> Hello Martin,
>
> sorry for the late reply ... I needed a little off time (for skiing and
> fetching some sun :-)).
> I tried to enable hibernate logging, but I can't get it to work :-(
> I copied the log4j.properties file
> (http://www.elver.org/hibernate/samples/log4j.properties) directly to
> the src folder of my EMF model plugin. I also added log4j.properties to
> bin.includes and src.includes of the build.properties.
> I also tried to directly add org.apache.log4j as dependency for the emf
> model plugin.
> But no hibernate stuff appears on the console, nor on the "Error Log".
> What else do I have to do? Add something to the source code?
>
> Best regards,
> Kai
>
>
> Martin Taal wrote:
>
>> Hi Kai,
>> I tested your ecore model and with me (and mysql) it seems to work
>> fine, I
> get a mediumtext column.
>> The bibernatemapping also seems correct to me:
>> <map name="testMap" lazy="true" cascade="all,delete-orphan">
>> <key update="true">
>> <column name="`testelement_testmap_e_id`" not-null="false"
>> unique="false"/>
>> </key>
>> <map-key type="java.lang.String"/>
>> <element type="text" not-null="false" unique="false">
>> <column not-null="false" unique="false" name="`value`"
>> length="1000000"/>
>> </element>
>> </map>
>
>> Can you enable hibernate logging and check why the table is not
>> created? My
> experience with
>> hibernate-mysql is that eventhough tables don't get created hibernate
>> still
> continues, the sql error
>> is then displayed in the log.
>
>> gr. Martin
>
>> Kai Schlamp wrote:
>>> Hy, Martin.
>>>
>>>> What exception do you get when trying out the lob and column
>>>> annotation on
>>> the value member of the emap?
>>>
>>> My intention is to store large strings (up to one million
>>> characters). Without specifying the @Lob and @Column(length=1000000)
>>> annotation for a string attribute Teneo/Hibernate creates a VARCHAR
>>> length=255 database field. This is a known problem with Derby, so the
>>> @Lob and @Column is a workaround. With the help of those annotations,
>>> Hibernate creates CLOB fields for those annotated string attributes.
>>> (See http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)
>>>
>>>> Can you post a small test model then I can try out what happens here? I
>>> checked the emap testcases I
>>>> have and they work fine. However, the current test case does not
>>>> contain the
>>> @Lob and @Column
>>>> annotation for the value side.
>>>
>>> Below my posting is the ecore and genmodel. It is a very simple test
>>> model with only two classes. I use the @Lob and @Column annotation
>>> direct on a string property and that works fine, Teneo/Hibernate
>>> creates a CLOB field for this class attribute.
>>> I also use the same annotation on the value attribute of the
>>> StringToStringMap, but this time Teneo/Hibernate does simply not
>>> create the appropriate table. When deleting the annotation of the
>>> value attribute, the table for the map is created, but the value
>>> field is only VARCHAR length=255 (as exspected).
>>>
>>>> Do you set any options when initializing the datastore?
>>>
>>> Nothing special:
>>> hibernateProperties.setProperty(Environment.USER, username);
>>> hibernateProperties.setProperty(Environment.PASS, password);
>>> hibernateProperties.setProperty(Environment.DRIVER, driver);
>>> hibernateProperties.setProperty(Environment.URL, url);
>>> hibernateProperties.setProperty(Environment.DIALECT, dialect);
>>>
>>> Thanks for the help,
>>> Kai
>>>
>>> Ecore ------------------------------------------------------------ -
>>>
>>> <?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="testmodel"
>>> nsURI="http://www.pubcurator.org/tester/testmodel"
>>> nsPrefix="org.pubcurator.tester.testmodel">
>>> <eClassifiers xsi:type="ecore:EClass" name="TestElement">
>>> <eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
>>> upperBound="-1"
>>> eType="#//StringToStringMap" containment="true"/>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="testProp"
>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> </eClassifiers>
>>> <eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
>>> instanceClassName="java.util.Map$Entry">
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>> eType="ecore:EDataType
>>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> </eClassifiers>
>>> </ecore:EPackage>
>>>
>>> Genmodel ----------------------------------------
>>>
>>> <?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.pubcurator.tester.testmodel/src"
>>> modelPluginID="org.pubcurator.tester.testmodel"
>>> modelName="Testmodel" importerID="org.eclipse.emf.importer.ecore"
>>> complianceLevel="6.0" copyrightFields="false">
>>> <foreignModel>testmodel.ecore</foreignModel>
>>> <genPackages prefix="TestModel" basePackage="org.pubcurator.tester"
>>> disposableProviderFactory="true"
>>> ecorePackage="testmodel.ecore#/">
>>> <genClasses ecoreClass="testmodel.ecore#//TestElement">
>>> <genFeatures property="None" children="true" createChild="true"
>>> ecoreFeature="ecore:EReference testmodel.ecore#//TestElement/testMap"/>
>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>> testmodel.ecore#//TestElement/testProp"/>
>>> </genClasses>
>>> <genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>> testmodel.ecore#//StringToStringMap/key"/>
>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>> testmodel.ecore#//StringToStringMap/value"/>
>>> </genClasses>
>>> </genPackages>
>>> </genmodel:GenModel>
>>>
>
>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #617971 is a reply to message #120640] Wed, 30 April 2008 21:07 Go to previous message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Hy Martin,

I managed getting log4j hibernate to work. I simply copied your
log4j.properties file as hibernate-log4j.properties in the
org.hibernate.eclipse_3.2.1.GA directory of the Eclipse hibernate plugin
(I use the plugin from here: http://www.hibernate.org/255.html).
Now everything is logged to the console, even if I run my application as
plugin within Eclipse (perhaps a good entry for your FAQ).

Ok, back to my main problem ... here is the interesting part from the log:
5053 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - create table
properties ("document_properties_id" bigint, "value" varchar(1000000), idx
varchar(255) not null, primary key ("document_properties_id", idx))
5081 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful:
create table properties ("document_properties_id" bigint, "value"
varchar(1000000), idx varchar(255) not null, primary key
("document_properties_id", idx))
5081 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - The length,
precision, or scale attribute for column, or type mapping
'VARCHAR(1000000)' is not valid.

As I stated in a previous post, "properties" is a attribute of "Document"
and is of type "StringToStringMap".
The "StringToStringMap" has a "key" and a "value" (both Strings).
"value" is annotated (the teneo.jpa way) with:
@Lob
@Column(length=1000000)

I would expect, that Hibernate uses not a VARCHAR, but a CLOB. It does
this correctly when adding the above annotation to an other attribute not
of a map type (e.g. a String attribute named "longtext" of "Document").

But it seems a bit that this this is a bug of hbm2ddl together with the
Derby dialect.
As I am already thinking about switching to HSQL, I hope that this won't
be a problem anymore then. I keep you updated, when I have done the switch.

I also have another little problem with bulk cascade delete, but I will
open a new thread for this.

Best regards,
Kai




Martin Taal wrote:

> Hi Kai,
> How do you run the program? I also find it difficult to get log4j working
when running programs as
> plugins within Eclipse. However when I run programs through static main
methods or junit then log4j
> output shows up.
> I would also check the output folder (bin) to see if the log4j.properties is
actually copied there.

> gr. Martin

> Kai Schlamp wrote:
>> Hello Martin,
>>
>> sorry for the late reply ... I needed a little off time (for skiing and
>> fetching some sun :-)).
>> I tried to enable hibernate logging, but I can't get it to work :-(
>> I copied the log4j.properties file
>> (http://www.elver.org/hibernate/samples/log4j.properties) directly to
>> the src folder of my EMF model plugin. I also added log4j.properties to
>> bin.includes and src.includes of the build.properties.
>> I also tried to directly add org.apache.log4j as dependency for the emf
>> model plugin.
>> But no hibernate stuff appears on the console, nor on the "Error Log".
>> What else do I have to do? Add something to the source code?
>>
>> Best regards,
>> Kai
>>
>>
>> Martin Taal wrote:
>>
>>> Hi Kai,
>>> I tested your ecore model and with me (and mysql) it seems to work
>>> fine, I
>> get a mediumtext column.
>>> The bibernatemapping also seems correct to me:
>>> <map name="testMap" lazy="true" cascade="all,delete-orphan">
>>> <key update="true">
>>> <column name="`testelement_testmap_e_id`" not-null="false"
>>> unique="false"/>
>>> </key>
>>> <map-key type="java.lang.String"/>
>>> <element type="text" not-null="false" unique="false">
>>> <column not-null="false" unique="false" name="`value`"
>>> length="1000000"/>
>>> </element>
>>> </map>
>>
>>> Can you enable hibernate logging and check why the table is not
>>> created? My
>> experience with
>>> hibernate-mysql is that eventhough tables don't get created hibernate
>>> still
>> continues, the sql error
>>> is then displayed in the log.
>>
>>> gr. Martin
>>
>>> Kai Schlamp wrote:
>>>> Hy, Martin.
>>>>
>>>>> What exception do you get when trying out the lob and column
>>>>> annotation on
>>>> the value member of the emap?
>>>>
>>>> My intention is to store large strings (up to one million
>>>> characters). Without specifying the @Lob and @Column(length=1000000)
>>>> annotation for a string attribute Teneo/Hibernate creates a VARCHAR
>>>> length=255 database field. This is a known problem with Derby, so the
>>>> @Lob and @Column is a workaround. With the help of those annotations,
>>>> Hibernate creates CLOB fields for those annotated string attributes.
>>>> (See http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)
>>>>
>>>>> Can you post a small test model then I can try out what happens here? I
>>>> checked the emap testcases I
>>>>> have and they work fine. However, the current test case does not
>>>>> contain the
>>>> @Lob and @Column
>>>>> annotation for the value side.
>>>>
>>>> Below my posting is the ecore and genmodel. It is a very simple test
>>>> model with only two classes. I use the @Lob and @Column annotation
>>>> direct on a string property and that works fine, Teneo/Hibernate
>>>> creates a CLOB field for this class attribute.
>>>> I also use the same annotation on the value attribute of the
>>>> StringToStringMap, but this time Teneo/Hibernate does simply not
>>>> create the appropriate table. When deleting the annotation of the
>>>> value attribute, the table for the map is created, but the value
>>>> field is only VARCHAR length=255 (as exspected).
>>>>
>>>>> Do you set any options when initializing the datastore?
>>>>
>>>> Nothing special:
>>>> hibernateProperties.setProperty(Environment.USER, username);
>>>> hibernateProperties.setProperty(Environment.PASS, password);
>>>> hibernateProperties.setProperty(Environment.DRIVER, driver);
>>>> hibernateProperties.setProperty(Environment.URL, url);
>>>> hibernateProperties.setProperty(Environment.DIALECT, dialect);
>>>>
>>>> Thanks for the help,
>>>> Kai
>>>>
>>>> Ecore ------------------------------------------------------------ -
>>>>
>>>> <?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="testmodel"
>>>> nsURI="http://www.pubcurator.org/tester/testmodel"
>>>> nsPrefix="org.pubcurator.tester.testmodel">
>>>> <eClassifiers xsi:type="ecore:EClass" name="TestElement">
>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
>>>> upperBound="-1"
>>>> eType="#//StringToStringMap" containment="true"/>
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="testProp"
>>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>>>> <eAnnotations source="teneo.jpa">
>>>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>>>> </eAnnotations>
>>>> </eStructuralFeatures>
>>>> </eClassifiers>
>>>> <eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
>>>> instanceClassName="java.util.Map$Entry">
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>>> eType="ecore:EDataType
>>>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>>>> <eAnnotations source="teneo.jpa">
>>>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>>>> </eAnnotations>
>>>> </eStructuralFeatures>
>>>> </eClassifiers>
>>>> </ecore:EPackage>
>>>>
>>>> Genmodel ----------------------------------------
>>>>
>>>> <?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.pubcurator.tester.testmodel/src"
>>>> modelPluginID="org.pubcurator.tester.testmodel"
>>>> modelName="Testmodel" importerID="org.eclipse.emf.importer.ecore"
>>>> complianceLevel="6.0" copyrightFields="false">
>>>> <foreignModel>testmodel.ecore</foreignModel>
>>>> <genPackages prefix="TestModel" basePackage="org.pubcurator.tester"
>>>> disposableProviderFactory="true"
>>>> ecorePackage="testmodel.ecore#/">
>>>> <genClasses ecoreClass="testmodel.ecore#//TestElement">
>>>> <genFeatures property="None" children="true" createChild="true"
>>>> ecoreFeature="ecore:EReference testmodel.ecore#//TestElement/testMap"/>
>>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>>> testmodel.ecore#//TestElement/testProp"/>
>>>> </genClasses>
>>>> <genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
>>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>>> testmodel.ecore#//StringToStringMap/key"/>
>>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>>> testmodel.ecore#//StringToStringMap/value"/>
>>>> </genClasses>
>>>> </genPackages>
>>>> </genmodel:GenModel>
>>>>
>>
>>
>>
>>
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #617974 is a reply to message #121574] Thu, 01 May 2008 12:25 Go to previous message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Ok, I tested the behavior with H2 database. The same thing here.
With the same annotation @Lob @Column(length=1000000000) Hibernate's
hbm2ddl one time creates a clob column for a String attribute of a normal
class and a other time tries to create a varchar column for a String
attribute of a StringToStringMap.
I am not really sure why this happens, but I simply avoid this problem now
by creating special string attributes for long strings, that are not
stored inside a StringToStringMap.

Kai

Kai Schlamp wrote:

> Hy Martin,

> I managed getting log4j hibernate to work. I simply copied your
> log4j.properties file as hibernate-log4j.properties in the
> org.hibernate.eclipse_3.2.1.GA directory of the Eclipse hibernate plugin
> (I use the plugin from here: http://www.hibernate.org/255.html).
> Now everything is logged to the console, even if I run my application as
> plugin within Eclipse (perhaps a good entry for your FAQ).

> Ok, back to my main problem ... here is the interesting part from the log:
> 5053 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - create table
> properties ("document_properties_id" bigint, "value" varchar(1000000), idx
> varchar(255) not null, primary key ("document_properties_id", idx))
> 5081 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful:
> create table properties ("document_properties_id" bigint, "value"
> varchar(1000000), idx varchar(255) not null, primary key
> ("document_properties_id", idx))
> 5081 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - The length,
> precision, or scale attribute for column, or type mapping
> 'VARCHAR(1000000)' is not valid.

> As I stated in a previous post, "properties" is a attribute of "Document"
> and is of type "StringToStringMap".
> The "StringToStringMap" has a "key" and a "value" (both Strings).
> "value" is annotated (the teneo.jpa way) with:
> @Lob
> @Column(length=1000000)

> I would expect, that Hibernate uses not a VARCHAR, but a CLOB. It does
> this correctly when adding the above annotation to an other attribute not
> of a map type (e.g. a String attribute named "longtext" of "Document").

> But it seems a bit that this this is a bug of hbm2ddl together with the
> Derby dialect.
> As I am already thinking about switching to HSQL, I hope that this won't
> be a problem anymore then. I keep you updated, when I have done the switch.

> I also have another little problem with bulk cascade delete, but I will
> open a new thread for this.

> Best regards,
> Kai




> Martin Taal wrote:

>> Hi Kai,
>> How do you run the program? I also find it difficult to get log4j working
> when running programs as
>> plugins within Eclipse. However when I run programs through static main
> methods or junit then log4j
>> output shows up.
>> I would also check the output folder (bin) to see if the log4j.properties
is
> actually copied there.

>> gr. Martin

>> Kai Schlamp wrote:
>>> Hello Martin,
>>>
>>> sorry for the late reply ... I needed a little off time (for skiing and
>>> fetching some sun :-)).
>>> I tried to enable hibernate logging, but I can't get it to work :-(
>>> I copied the log4j.properties file
>>> (http://www.elver.org/hibernate/samples/log4j.properties) directly to
>>> the src folder of my EMF model plugin. I also added log4j.properties to
>>> bin.includes and src.includes of the build.properties.
>>> I also tried to directly add org.apache.log4j as dependency for the emf
>>> model plugin.
>>> But no hibernate stuff appears on the console, nor on the "Error Log".
>>> What else do I have to do? Add something to the source code?
>>>
>>> Best regards,
>>> Kai
>>>
>>>
>>> Martin Taal wrote:
>>>
>>>> Hi Kai,
>>>> I tested your ecore model and with me (and mysql) it seems to work
>>>> fine, I
>>> get a mediumtext column.
>>>> The bibernatemapping also seems correct to me:
>>>> <map name="testMap" lazy="true" cascade="all,delete-orphan">
>>>> <key update="true">
>>>> <column name="`testelement_testmap_e_id`" not-null="false"
>>>> unique="false"/>
>>>> </key>
>>>> <map-key type="java.lang.String"/>
>>>> <element type="text" not-null="false" unique="false">
>>>> <column not-null="false" unique="false" name="`value`"
>>>> length="1000000"/>
>>>> </element>
>>>> </map>
>>>
>>>> Can you enable hibernate logging and check why the table is not
>>>> created? My
>>> experience with
>>>> hibernate-mysql is that eventhough tables don't get created hibernate
>>>> still
>>> continues, the sql error
>>>> is then displayed in the log.
>>>
>>>> gr. Martin
>>>
>>>> Kai Schlamp wrote:
>>>>> Hy, Martin.
>>>>>
>>>>>> What exception do you get when trying out the lob and column
>>>>>> annotation on
>>>>> the value member of the emap?
>>>>>
>>>>> My intention is to store large strings (up to one million
>>>>> characters). Without specifying the @Lob and @Column(length=1000000)
>>>>> annotation for a string attribute Teneo/Hibernate creates a VARCHAR
>>>>> length=255 database field. This is a known problem with Derby, so the
>>>>> @Lob and @Column is a workaround. With the help of those annotations,
>>>>> Hibernate creates CLOB fields for those annotated string attributes.
>>>>> (See http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)
>>>>>
>>>>>> Can you post a small test model then I can try out what happens here? I
>>>>> checked the emap testcases I
>>>>>> have and they work fine. However, the current test case does not
>>>>>> contain the
>>>>> @Lob and @Column
>>>>>> annotation for the value side.
>>>>>
>>>>> Below my posting is the ecore and genmodel. It is a very simple test
>>>>> model with only two classes. I use the @Lob and @Column annotation
>>>>> direct on a string property and that works fine, Teneo/Hibernate
>>>>> creates a CLOB field for this class attribute.
>>>>> I also use the same annotation on the value attribute of the
>>>>> StringToStringMap, but this time Teneo/Hibernate does simply not
>>>>> create the appropriate table. When deleting the annotation of the
>>>>> value attribute, the table for the map is created, but the value
>>>>> field is only VARCHAR length=255 (as exspected).
>>>>>
>>>>>> Do you set any options when initializing the datastore?
>>>>>
>>>>> Nothing special:
>>>>> hibernateProperties.setProperty(Environment.USER, username);
>>>>> hibernateProperties.setProperty(Environment.PASS, password);
>>>>> hibernateProperties.setProperty(Environment.DRIVER, driver);
>>>>> hibernateProperties.setProperty(Environment.URL, url);
>>>>> hibernateProperties.setProperty(Environment.DIALECT, dialect);
>>>>>
>>>>> Thanks for the help,
>>>>> Kai
>>>>>
>>>>> Ecore ------------------------------------------------------------ -
>>>>>
>>>>> <?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="testmodel"
>>>>> nsURI="http://www.pubcurator.org/tester/testmodel"
>>>>> nsPrefix="org.pubcurator.tester.testmodel">
>>>>> <eClassifiers xsi:type="ecore:EClass" name="TestElement">
>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
>>>>> upperBound="-1"
>>>>> eType="#//StringToStringMap" containment="true"/>
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="testProp"
>>>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>>>>> <eAnnotations source="teneo.jpa">
>>>>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>>>>> </eAnnotations>
>>>>> </eStructuralFeatures>
>>>>> </eClassifiers>
>>>>> <eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
>>>>> instanceClassName="java.util.Map$Entry">
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>>>> eType="ecore:EDataType
>>>>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
>>>>> <eAnnotations source="teneo.jpa">
>>>>> <details key="value" value="@Lob&#xA;@Column(length=1000000)"/>
>>>>> </eAnnotations>
>>>>> </eStructuralFeatures>
>>>>> </eClassifiers>
>>>>> </ecore:EPackage>
>>>>>
>>>>> Genmodel ----------------------------------------
>>>>>
>>>>> <?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.pubcurator.tester.testmodel/src"
>>>>> modelPluginID="org.pubcurator.tester.testmodel"
>>>>> modelName="Testmodel" importerID="org.eclipse.emf.importer.ecore"
>>>>> complianceLevel="6.0" copyrightFields="false">
>>>>> <foreignModel>testmodel.ecore</foreignModel>
>>>>> <genPackages prefix="TestModel" basePackage="org.pubcurator.tester"
>>>>> disposableProviderFactory="true"
>>>>> ecorePackage="testmodel.ecore#/">
>>>>> <genClasses ecoreClass="testmodel.ecore#//TestElement">
>>>>> <genFeatures property="None" children="true" createChild="true"
>>>>> ecoreFeature="ecore:EReference testmodel.ecore#//TestElement/testMap"/>
>>>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>>>> testmodel.ecore#//TestElement/testProp"/>
>>>>> </genClasses>
>>>>> <genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
>>>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>>>> testmodel.ecore#//StringToStringMap/key"/>
>>>>> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute
>>>>> testmodel.ecore#//StringToStringMap/value"/>
>>>>> </genClasses>
>>>>> </genPackages>
>>>>> </genmodel:GenModel>
>>>>>
>>>
>>>
>>>
>>>
Re: [Teneo] Problem with StringToStringMap and @Lob @Column Annotation [message #617982 is a reply to message #121611] Fri, 02 May 2008 05:32 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Kai,
How does the hibernate mapping of the map look like? Does Teneo set a type="text"?

gr. Martin

Kai Schlamp wrote:
> Ok, I tested the behavior with H2 database. The same thing here.
> With the same annotation @Lob @Column(length=1000000000) Hibernate's
> hbm2ddl one time creates a clob column for a String attribute of a
> normal class and a other time tries to create a varchar column for a
> String attribute of a StringToStringMap.
> I am not really sure why this happens, but I simply avoid this problem
> now by creating special string attributes for long strings, that are not
> stored inside a StringToStringMap.
>
> Kai
>
> Kai Schlamp wrote:
>
>> Hy Martin,
>
>> I managed getting log4j hibernate to work. I simply copied your
>> log4j.properties file as hibernate-log4j.properties in the
>> org.hibernate.eclipse_3.2.1.GA directory of the Eclipse hibernate
>> plugin (I use the plugin from here: http://www.hibernate.org/255.html).
>> Now everything is logged to the console, even if I run my application
>> as plugin within Eclipse (perhaps a good entry for your FAQ).
>
>> Ok, back to my main problem ... here is the interesting part from the
>> log:
>> 5053 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - create
>> table properties ("document_properties_id" bigint, "value"
>> varchar(1000000), idx varchar(255) not null, primary key
>> ("document_properties_id", idx))
>> 5081 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate -
>> Unsuccessful: create table properties ("document_properties_id"
>> bigint, "value" varchar(1000000), idx varchar(255) not null, primary
>> key ("document_properties_id", idx))
>> 5081 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - The
>> length, precision, or scale attribute for column, or type mapping
>> 'VARCHAR(1000000)' is not valid.
>
>> As I stated in a previous post, "properties" is a attribute of
>> "Document" and is of type "StringToStringMap".
>> The "StringToStringMap" has a "key" and a "value" (both Strings).
>> "value" is annotated (the teneo.jpa way) with:
>> @Lob
>> @Column(length=1000000)
>
>> I would expect, that Hibernate uses not a VARCHAR, but a CLOB. It does
>> this correctly when adding the above annotation to an other attribute
>> not of a map type (e.g. a String attribute named "longtext" of
>> "Document").
>
>> But it seems a bit that this this is a bug of hbm2ddl together with
>> the Derby dialect.
>> As I am already thinking about switching to HSQL, I hope that this
>> won't be a problem anymore then. I keep you updated, when I have done
>> the switch.
>
>> I also have another little problem with bulk cascade delete, but I
>> will open a new thread for this.
>
>> Best regards,
>> Kai
>
>
>
>
>> Martin Taal wrote:
>
>>> Hi Kai,
>>> How do you run the program? I also find it difficult to get log4j
>>> working
>> when running programs as
>>> plugins within Eclipse. However when I run programs through static main
>> methods or junit then log4j
>>> output shows up.
>>> I would also check the output folder (bin) to see if the
>>> log4j.properties
> is
>> actually copied there.
>
>>> gr. Martin
>
>>> Kai Schlamp wrote:
>>>> Hello Martin,
>>>>
>>>> sorry for the late reply ... I needed a little off time (for skiing
>>>> and fetching some sun :-)).
>>>> I tried to enable hibernate logging, but I can't get it to work :-(
>>>> I copied the log4j.properties file
>>>> (http://www.elver.org/hibernate/samples/log4j.properties) directly
>>>> to the src folder of my EMF model plugin. I also added
>>>> log4j.properties to bin.includes and src.includes of the
>>>> build.properties.
>>>> I also tried to directly add org.apache.log4j as dependency for the
>>>> emf model plugin.
>>>> But no hibernate stuff appears on the console, nor on the "Error Log".
>>>> What else do I have to do? Add something to the source code?
>>>>
>>>> Best regards,
>>>> Kai
>>>>
>>>>
>>>> Martin Taal wrote:
>>>>
>>>>> Hi Kai,
>>>>> I tested your ecore model and with me (and mysql) it seems to work
>>>>> fine, I
>>>> get a mediumtext column.
>>>>> The bibernatemapping also seems correct to me:
>>>>> <map name="testMap" lazy="true" cascade="all,delete-orphan">
>>>>> <key update="true">
>>>>> <column name="`testelement_testmap_e_id`" not-null="false"
>>>>> unique="false"/>
>>>>> </key>
>>>>> <map-key type="java.lang.String"/>
>>>>> <element type="text" not-null="false" unique="false">
>>>>> <column not-null="false" unique="false" name="`value`"
>>>>> length="1000000"/>
>>>>> </element>
>>>>> </map>
>>>>
>>>>> Can you enable hibernate logging and check why the table is not
>>>>> created? My
>>>> experience with
>>>>> hibernate-mysql is that eventhough tables don't get created
>>>>> hibernate still
>>>> continues, the sql error
>>>>> is then displayed in the log.
>>>>
>>>>> gr. Martin
>>>>
>>>>> Kai Schlamp wrote:
>>>>>> Hy, Martin.
>>>>>>
>>>>>>> What exception do you get when trying out the lob and column
>>>>>>> annotation on
>>>>>> the value member of the emap?
>>>>>>
>>>>>> My intention is to store large strings (up to one million
>>>>>> characters). Without specifying the @Lob and
>>>>>> @Column(length=1000000) annotation for a string attribute
>>>>>> Teneo/Hibernate creates a VARCHAR length=255 database field. This
>>>>>> is a known problem with Derby, so the @Lob and @Column is a
>>>>>> workaround. With the help of those annotations, Hibernate creates
>>>>>> CLOB fields for those annotated string attributes. (See
>>>>>> http://opensource.atlassian.com/projects/hibernate/browse/HH H-2614)
>>>>>>
>>>>>>> Can you post a small test model then I can try out what happens
>>>>>>> here? I
>>>>>> checked the emap testcases I
>>>>>>> have and they work fine. However, the current test case does not
>>>>>>> contain the
>>>>>> @Lob and @Column
>>>>>>> annotation for the value side.
>>>>>>
>>>>>> Below my posting is the ecore and genmodel. It is a very simple
>>>>>> test model with only two classes. I use the @Lob and @Column
>>>>>> annotation direct on a string property and that works fine,
>>>>>> Teneo/Hibernate creates a CLOB field for this class attribute.
>>>>>> I also use the same annotation on the value attribute of the
>>>>>> StringToStringMap, but this time Teneo/Hibernate does simply not
>>>>>> create the appropriate table. When deleting the annotation of the
>>>>>> value attribute, the table for the map is created, but the value
>>>>>> field is only VARCHAR length=255 (as exspected).
>>>>>>
>>>>>>> Do you set any options when initializing the datastore?
>>>>>>
>>>>>> Nothing special:
>>>>>> hibernateProperties.setProperty(Environment.USER, username);
>>>>>> hibernateProperties.setProperty(Environment.PASS, password);
>>>>>> hibernateProperties.setProperty(Environment.DRIVER, driver);
>>>>>> hibernateProperties.setProperty(Environment.URL, url);
>>>>>> hibernateProperties.setProperty(Environment.DIALECT, dialect);
>>>>>>
>>>>>> Thanks for the help,
>>>>>> Kai
>>>>>>
>>>>>> Ecore ------------------------------------------------------------ -
>>>>>>
>>>>>> <?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="testmodel"
>>>>>> nsURI="http://www.pubcurator.org/tester/testmodel"
>>>>>> nsPrefix="org.pubcurator.tester.testmodel">
>>>>>> <eClassifiers xsi:type="ecore:EClass" name="TestElement">
>>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="testMap"
>>>>>> upperBound="-1"
>>>>>> eType="#//StringToStringMap" containment="true"/>
>>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute"
>>>>>> name="testProp" eType="ecore:EDataType
>>>>>> http://www.eclipse.org/emf/2002/Ecore#//EString">
>>>>>> <eAnnotations source="teneo.jpa">
>>>>>> <details key="value"
>>>>>> value="@Lob&#xA;@Column(length=1000000)"/>
>>>>>> </eAnnotations>
>>>>>> </eStructuralFeatures>
>>>>>> </eClassifiers>
>>>>>> <eClassifiers xsi:type="ecore:EClass" name="StringToStringMap"
>>>>>> instanceClassName="java.util.Map$Entry">
>>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key"
>>>>>> eType="ecore:EDataType
>>>>>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>>>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value"
>>>>>> eType="ecore:EDataType
>>>>>> http://www.eclipse.org/emf/2002/Ecore#//EString">
>>>>>> <eAnnotations source="teneo.jpa">
>>>>>> <details key="value"
>>>>>> value="@Lob&#xA;@Column(length=1000000)"/>
>>>>>> </eAnnotations>
>>>>>> </eStructuralFeatures>
>>>>>> </eClassifiers>
>>>>>> </ecore:EPackage>
>>>>>>
>>>>>> Genmodel ----------------------------------------
>>>>>>
>>>>>> <?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.pubcurator.tester.testmodel/src"
>>>>>> modelPluginID="org.pubcurator.tester.testmodel"
>>>>>> modelName="Testmodel" importerID="org.eclipse.emf.importer.ecore"
>>>>>> complianceLevel="6.0" copyrightFields="false">
>>>>>> <foreignModel>testmodel.ecore</foreignModel>
>>>>>> <genPackages prefix="TestModel"
>>>>>> basePackage="org.pubcurator.tester" disposableProviderFactory="true"
>>>>>> ecorePackage="testmodel.ecore#/">
>>>>>> <genClasses ecoreClass="testmodel.ecore#//TestElement">
>>>>>> <genFeatures property="None" children="true"
>>>>>> createChild="true" ecoreFeature="ecore:EReference
>>>>>> testmodel.ecore#//TestElement/testMap"/>
>>>>>> <genFeatures createChild="false"
>>>>>> ecoreFeature="ecore:EAttribute
>>>>>> testmodel.ecore#//TestElement/testProp"/>
>>>>>> </genClasses>
>>>>>> <genClasses ecoreClass="testmodel.ecore#//StringToStringMap">
>>>>>> <genFeatures createChild="false"
>>>>>> ecoreFeature="ecore:EAttribute
>>>>>> testmodel.ecore#//StringToStringMap/key"/>
>>>>>> <genFeatures createChild="false"
>>>>>> ecoreFeature="ecore:EAttribute
>>>>>> testmodel.ecore#//StringToStringMap/value"/>
>>>>>> </genClasses>
>>>>>> </genPackages>
>>>>>> </genmodel:GenModel>
>>>>>>
>>>>
>>>>
>>>>
>>>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:[Teneo/Hibernate] Delete many objects from database at once
Next Topic:[EMF Compare]MatchEngine NPE bug
Goto Forum:
  


Current Time: Thu Apr 18 02:54:42 GMT 2024

Powered by FUDForum. Page generated in 0.02900 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top