Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Multivalued EAttributes of EDataTypes do not have the correct Hibernate mapping
[Teneo] Multivalued EAttributes of EDataTypes do not have the correct Hibernate mapping [message #79974] Tue, 17 April 2007 03:51 Go to next message
Michael Kanaley is currently offline Michael KanaleyFriend
Messages: 89
Registered: July 2009
Member
Hello Martin,
I have attached a bundle that you can directly import into Eclipse.
I have removed hibernate and other third party JARs to keep the attachment
small so it will not run until you put all the jars in the lib directory.
It uses HSQLDB and the latest 0.7.5 Teneo.
I can send you the jars if necessary.
It will add a launcher called test.teneo.multidatatype.

This model plugin has one class called SomeClass that has a single
EAttribute called "myProperty" of type SomeEnum that has
upperbound of -1. Teneo is creating a mapping for this attribute of the
form:
<list name="myProperty" lazy="true" cascade="all,delete-orphan">

<key update="true">

<column name="`someclass_myproperty_e_id`" not-null="true" unique="false"/>

</key>

<list-index column="`someclass_myproperty_idx`"/>

<element type="test.teneo.multidatatype.SomeEnum"/>

</list>

When I try to persist an instance of this model, the exception at the end of
this message is
thrown. Unfortunately, the type should be refering to a typedef instead of
the custom EDataType class.
The list mapping should have had an element of the form:
<element type="multidatatype.SomeEnum"/>

The typedef multidatatype.SomeEnum should have been declared like:
<typedef name="multidatatype.SomeEnum"
class=" org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype ">

<param
name="epackage">http://xsd.example.org/test/multidatatype</param>

<param name="edatatype">SomeEnum</param>

</typedef>


Fortunately, there is a simple workaround by declaring an annotation on the
SomeEnum EDataType of the form:
@TypeDef(
name="multidatatype.SomeEnum",
typeClass =
org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype,
parameters = {
@Parameter(name="epackage",
value="http://xsd.example.org/test/multidatatype")
@Parameter(name="edatatype", value="SomeEnum")
}
)

Please let me know if this is considered a bug and I will file a bugzilla.
Thanks,
-mike

org.hibernate.MappingException: Could not determine type for:
test.teneo.multidatatype.SomeEnum, for columns:
[org.hibernate.mapping.Column(elt)]

at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)

at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:138)

at org.hibernate.mapping.Column.getSqlType(Column.java:182)

at org.hibernate.mapping.Table.sqlCreateString(Table.java:383)

at
org.hibernate.cfg.Configuration.generateSchemaUpdateScript(C onfiguration.java:884)

at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:140)

at
org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:478)

at
org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:180)

at test.teneo.MapTests.createHbDataStore(MapTests.java:72)

at test.teneo.MapTests.testSaving(MapTests.java:86)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at junit.framework.TestCase.runTest(TestCase.java:154)

at junit.framework.TestCase.runBare(TestCase.java:127)

at junit.framework.TestResult$1.protect(TestResult.java:106)

at junit.framework.TestResult.runProtected(TestResult.java:124)

at junit.framework.TestResult.run(TestResult.java:109)

at junit.framework.TestCase.run(TestCase.java:118)

at junit.framework.TestSuite.runTest(TestSuite.java:208)

at junit.framework.TestSuite.run(TestSuite.java:203)

at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:128)

at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)

at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)

at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)

at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)

at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)


Re: [Teneo] Multivalued EAttributes of EDataTypes do not have the correct Hibernate mapping [message #80040 is a reply to message #79974] Tue, 17 April 2007 15:26 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mike,
I ran your testcase (thanks) and it fails with me also. With the 0.8.0 release this seems to work
but Hibernate serializes the enumerates which is not the best solution (not queryable, etc.).

Teneo will add a typedef for an EDataType automatically but not for enums, also the instanceclass of
the edatatype is used in these auto-created typedefs.
This auto-typedef creation should then also be done for enums (with a different usertype than the
edatatype instanceclass).
Can you enter a bugzilla for this? Then I'll add this.

Btw, for enumerates the typedef will be different than you propose as Teneo has a number of default
usertypes for enumerates.

gr. Martin

Michael Kanaley wrote:
> Hello Martin,
> I have attached a bundle that you can directly import into Eclipse.
> I have removed hibernate and other third party JARs to keep the attachment
> small so it will not run until you put all the jars in the lib directory.
> It uses HSQLDB and the latest 0.7.5 Teneo.
> I can send you the jars if necessary.
> It will add a launcher called test.teneo.multidatatype.
>
> This model plugin has one class called SomeClass that has a single
> EAttribute called "myProperty" of type SomeEnum that has
> upperbound of -1. Teneo is creating a mapping for this attribute of the
> form:
> <list name="myProperty" lazy="true" cascade="all,delete-orphan">
>
> <key update="true">
>
> <column name="`someclass_myproperty_e_id`" not-null="true" unique="false"/>
>
> </key>
>
> <list-index column="`someclass_myproperty_idx`"/>
>
> <element type="test.teneo.multidatatype.SomeEnum"/>
>
> </list>
>
> When I try to persist an instance of this model, the exception at the end of
> this message is
> thrown. Unfortunately, the type should be refering to a typedef instead of
> the custom EDataType class.
> The list mapping should have had an element of the form:
> <element type="multidatatype.SomeEnum"/>
>
> The typedef multidatatype.SomeEnum should have been declared like:
> <typedef name="multidatatype.SomeEnum"
> class=" org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype ">
>
> <param
> name="epackage">http://xsd.example.org/test/multidatatype</param>
>
> <param name="edatatype">SomeEnum</param>
>
> </typedef>
>
>
> Fortunately, there is a simple workaround by declaring an annotation on the
> SomeEnum EDataType of the form:
> @TypeDef(
> name="multidatatype.SomeEnum",
> typeClass =
> org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype,
> parameters = {
> @Parameter(name="epackage",
> value="http://xsd.example.org/test/multidatatype")
> @Parameter(name="edatatype", value="SomeEnum")
> }
> )
>
> Please let me know if this is considered a bug and I will file a bugzilla.
> Thanks,
> -mike
>
> org.hibernate.MappingException: Could not determine type for:
> test.teneo.multidatatype.SomeEnum, for columns:
> [org.hibernate.mapping.Column(elt)]
>
> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>
> at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:138)
>
> at org.hibernate.mapping.Column.getSqlType(Column.java:182)
>
> at org.hibernate.mapping.Table.sqlCreateString(Table.java:383)
>
> at
> org.hibernate.cfg.Configuration.generateSchemaUpdateScript(C onfiguration.java:884)
>
> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:140)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:478)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:180)
>
> at test.teneo.MapTests.createHbDataStore(MapTests.java:72)
>
> at test.teneo.MapTests.testSaving(MapTests.java:86)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>
> at java.lang.reflect.Method.invoke(Unknown Source)
>
> at junit.framework.TestCase.runTest(TestCase.java:154)
>
> at junit.framework.TestCase.runBare(TestCase.java:127)
>
> at junit.framework.TestResult$1.protect(TestResult.java:106)
>
> at junit.framework.TestResult.runProtected(TestResult.java:124)
>
> at junit.framework.TestResult.run(TestResult.java:109)
>
> at junit.framework.TestCase.run(TestCase.java:118)
>
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
>
> at junit.framework.TestSuite.run(TestSuite.java:203)
>
> at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:128)
>
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>
>


--

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] Multivalued EAttributes of EDataTypes do not have the correct Hibernate mapping [message #80126 is a reply to message #80040] Tue, 17 April 2007 19:30 Go to previous messageGo to next message
Michael Kanaley is currently offline Michael KanaleyFriend
Messages: 89
Registered: July 2009
Member
Hi Martin,
Filed bugzilla number: 182815
First question, what exactly should the correct ENum annotation look like?
Another general problem with your ENum UserTypes is that they use an
enumClass reference.
Like you have said before, this does not support dynamic EMF.

Also, there is a problem when trying to run Teneo in an OSGi environment.
When Teneo attempts to load this class, the ClassLoaderResolver has to be
set correctly - which is near impossible in OSGi which means that Teneo has
to declare DynamicImport-Package: * to load the ENum attributes.

This is not ideal since it binds the class instance to the Teneo plugin so
different versions of the same EMF model cannot be used in the same OSGi
runtime.
Thanks,
-mike

"Martin Taal" <mtaal@elver.org> wrote in message
news:f02ouh$vvd$1@build.eclipse.org...
> Hi Mike,
> I ran your testcase (thanks) and it fails with me also. With the 0.8.0
> release this seems to work but Hibernate serializes the enumerates which
> is not the best solution (not queryable, etc.).
>
> Teneo will add a typedef for an EDataType automatically but not for enums,
> also the instanceclass of the edatatype is used in these auto-created
> typedefs.
> This auto-typedef creation should then also be done for enums (with a
> different usertype than the edatatype instanceclass).
> Can you enter a bugzilla for this? Then I'll add this.
>
> Btw, for enumerates the typedef will be different than you propose as
> Teneo has a number of default usertypes for enumerates.
>
> gr. Martin
>
> Michael Kanaley wrote:
>> Hello Martin,
>> I have attached a bundle that you can directly import into Eclipse.
>> I have removed hibernate and other third party JARs to keep the
>> attachment
>> small so it will not run until you put all the jars in the lib directory.
>> It uses HSQLDB and the latest 0.7.5 Teneo.
>> I can send you the jars if necessary.
>> It will add a launcher called test.teneo.multidatatype.
>>
>> This model plugin has one class called SomeClass that has a single
>> EAttribute called "myProperty" of type SomeEnum that has
>> upperbound of -1. Teneo is creating a mapping for this attribute of the
>> form:
>> <list name="myProperty" lazy="true" cascade="all,delete-orphan">
>>
>> <key update="true">
>>
>> <column name="`someclass_myproperty_e_id`" not-null="true"
>> unique="false"/>
>>
>> </key>
>>
>> <list-index column="`someclass_myproperty_idx`"/>
>>
>> <element type="test.teneo.multidatatype.SomeEnum"/>
>>
>> </list>
>>
>> When I try to persist an instance of this model, the exception at the end
>> of this message is
>> thrown. Unfortunately, the type should be refering to a typedef instead
>> of the custom EDataType class.
>> The list mapping should have had an element of the form:
>> <element type="multidatatype.SomeEnum"/>
>>
>> The typedef multidatatype.SomeEnum should have been declared like:
>> <typedef name="multidatatype.SomeEnum"
>> class=" org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype ">
>>
>> <param
>> name="epackage">http://xsd.example.org/test/multidatatype</param>
>>
>> <param name="edatatype">SomeEnum</param>
>>
>> </typedef>
>>
>>
>> Fortunately, there is a simple workaround by declaring an annotation on
>> the SomeEnum EDataType of the form:
>> @TypeDef(
>> name="multidatatype.SomeEnum",
>> typeClass =
>> org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype,
>> parameters = {
>> @Parameter(name="epackage",
>> value="http://xsd.example.org/test/multidatatype")
>> @Parameter(name="edatatype", value="SomeEnum")
>> }
>> )
>>
>> Please let me know if this is considered a bug and I will file a
>> bugzilla.
>> Thanks,
>> -mike
>>
>> org.hibernate.MappingException: Could not determine type for:
>> test.teneo.multidatatype.SomeEnum, for columns:
>> [org.hibernate.mapping.Column(elt)]
>>
>> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>>
>> at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:138)
>>
>> at org.hibernate.mapping.Column.getSqlType(Column.java:182)
>>
>> at org.hibernate.mapping.Table.sqlCreateString(Table.java:383)
>>
>> at
>> org.hibernate.cfg.Configuration.generateSchemaUpdateScript(C onfiguration.java:884)
>>
>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:140)
>>
>> at
>> org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:478)
>>
>> at
>> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:180)
>>
>> at test.teneo.MapTests.createHbDataStore(MapTests.java:72)
>>
>> at test.teneo.MapTests.testSaving(MapTests.java:86)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>
>> at java.lang.reflect.Method.invoke(Unknown Source)
>>
>> at junit.framework.TestCase.runTest(TestCase.java:154)
>>
>> at junit.framework.TestCase.runBare(TestCase.java:127)
>>
>> at junit.framework.TestResult$1.protect(TestResult.java:106)
>>
>> at junit.framework.TestResult.runProtected(TestResult.java:124)
>>
>> at junit.framework.TestResult.run(TestResult.java:109)
>>
>> at junit.framework.TestCase.run(TestCase.java:118)
>>
>> at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>
>> at junit.framework.TestSuite.run(TestSuite.java:203)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:128)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>>
>>
>
>
> --
>
> 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] Multivalued EAttributes of EDataTypes do not have the correct Hibernate mapping [message #80142 is a reply to message #80126] Tue, 17 April 2007 20:02 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mike,
Yes seen it.

I am not sure what you with mean with enum annotation? Do you mean the typedef?

Teneo also supports enums with dynamic EMF. Here is an example of the mapping of a single property
if there is no instanceclass:
<property name="departmentType" lazy="false" not-null="false" insert="true" update="true"
unique="false">
<column not-null="false" unique="false" name="`departmenttype`"/>
<type name="org.eclipse.emf.teneo.hibernate.mapping.DynamicENumUserType ">
<param name="eclassifier">DepartmentType</param>
<param name="epackage">http:///www.elver.org/DynamicTest</param>
</type>
</property>

Your point regarding osgi is interesting.
I would think that the issue you mention is larger than just the enum class as the
classloaderresolver is also used in other locations.
I have very little experience yet with running in osgi environments (and little time on the short
term to gain experience). So if you have any contributions which would solve this issue (for you)
then I am happy to look at them and incorporate them.

gr. Martin

Michael Kanaley wrote:
> Hi Martin,
> Filed bugzilla number: 182815
> First question, what exactly should the correct ENum annotation look like?
> Another general problem with your ENum UserTypes is that they use an
> enumClass reference.
> Like you have said before, this does not support dynamic EMF.
>
> Also, there is a problem when trying to run Teneo in an OSGi environment.
> When Teneo attempts to load this class, the ClassLoaderResolver has to be
> set correctly - which is near impossible in OSGi which means that Teneo has
> to declare DynamicImport-Package: * to load the ENum attributes.
>
> This is not ideal since it binds the class instance to the Teneo plugin so
> different versions of the same EMF model cannot be used in the same OSGi
> runtime.
> Thanks,
> -mike
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:f02ouh$vvd$1@build.eclipse.org...
>> Hi Mike,
>> I ran your testcase (thanks) and it fails with me also. With the 0.8.0
>> release this seems to work but Hibernate serializes the enumerates which
>> is not the best solution (not queryable, etc.).
>>
>> Teneo will add a typedef for an EDataType automatically but not for enums,
>> also the instanceclass of the edatatype is used in these auto-created
>> typedefs.
>> This auto-typedef creation should then also be done for enums (with a
>> different usertype than the edatatype instanceclass).
>> Can you enter a bugzilla for this? Then I'll add this.
>>
>> Btw, for enumerates the typedef will be different than you propose as
>> Teneo has a number of default usertypes for enumerates.
>>
>> gr. Martin
>>
>> Michael Kanaley wrote:
>>> Hello Martin,
>>> I have attached a bundle that you can directly import into Eclipse.
>>> I have removed hibernate and other third party JARs to keep the
>>> attachment
>>> small so it will not run until you put all the jars in the lib directory.
>>> It uses HSQLDB and the latest 0.7.5 Teneo.
>>> I can send you the jars if necessary.
>>> It will add a launcher called test.teneo.multidatatype.
>>>
>>> This model plugin has one class called SomeClass that has a single
>>> EAttribute called "myProperty" of type SomeEnum that has
>>> upperbound of -1. Teneo is creating a mapping for this attribute of the
>>> form:
>>> <list name="myProperty" lazy="true" cascade="all,delete-orphan">
>>>
>>> <key update="true">
>>>
>>> <column name="`someclass_myproperty_e_id`" not-null="true"
>>> unique="false"/>
>>>
>>> </key>
>>>
>>> <list-index column="`someclass_myproperty_idx`"/>
>>>
>>> <element type="test.teneo.multidatatype.SomeEnum"/>
>>>
>>> </list>
>>>
>>> When I try to persist an instance of this model, the exception at the end
>>> of this message is
>>> thrown. Unfortunately, the type should be refering to a typedef instead
>>> of the custom EDataType class.
>>> The list mapping should have had an element of the form:
>>> <element type="multidatatype.SomeEnum"/>
>>>
>>> The typedef multidatatype.SomeEnum should have been declared like:
>>> <typedef name="multidatatype.SomeEnum"
>>> class=" org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype ">
>>>
>>> <param
>>> name="epackage">http://xsd.example.org/test/multidatatype</param>
>>>
>>> <param name="edatatype">SomeEnum</param>
>>>
>>> </typedef>
>>>
>>>
>>> Fortunately, there is a simple workaround by declaring an annotation on
>>> the SomeEnum EDataType of the form:
>>> @TypeDef(
>>> name="multidatatype.SomeEnum",
>>> typeClass =
>>> org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype,
>>> parameters = {
>>> @Parameter(name="epackage",
>>> value="http://xsd.example.org/test/multidatatype")
>>> @Parameter(name="edatatype", value="SomeEnum")
>>> }
>>> )
>>>
>>> Please let me know if this is considered a bug and I will file a
>>> bugzilla.
>>> Thanks,
>>> -mike
>>>
>>> org.hibernate.MappingException: Could not determine type for:
>>> test.teneo.multidatatype.SomeEnum, for columns:
>>> [org.hibernate.mapping.Column(elt)]
>>>
>>> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>>>
>>> at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:138)
>>>
>>> at org.hibernate.mapping.Column.getSqlType(Column.java:182)
>>>
>>> at org.hibernate.mapping.Table.sqlCreateString(Table.java:383)
>>>
>>> at
>>> org.hibernate.cfg.Configuration.generateSchemaUpdateScript(C onfiguration.java:884)
>>>
>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:140)
>>>
>>> at
>>> org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:478)
>>>
>>> at
>>> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:180)
>>>
>>> at test.teneo.MapTests.createHbDataStore(MapTests.java:72)
>>>
>>> at test.teneo.MapTests.testSaving(MapTests.java:86)
>>>
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>
>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>
>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>
>>> at junit.framework.TestCase.runTest(TestCase.java:154)
>>>
>>> at junit.framework.TestCase.runBare(TestCase.java:127)
>>>
>>> at junit.framework.TestResult$1.protect(TestResult.java:106)
>>>
>>> at junit.framework.TestResult.runProtected(TestResult.java:124)
>>>
>>> at junit.framework.TestResult.run(TestResult.java:109)
>>>
>>> at junit.framework.TestCase.run(TestCase.java:118)
>>>
>>> at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>
>>> at junit.framework.TestSuite.run(TestSuite.java:203)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:128)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>>>
>>>
>>
>> --
>>
>> 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
>
>


--

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] Multivalued EAttributes of EDataTypes do not have the correct Hibernate mapping [message #80186 is a reply to message #80142] Tue, 17 April 2007 21:30 Go to previous messageGo to next message
Michael Kanaley is currently offline Michael KanaleyFriend
Messages: 89
Registered: July 2009
Member
Hi Martin,
> I am not sure what you with mean with enum annotation? Do you mean the
> typedef?
I have defined the following annotation on the EEnum:
@TypeDef(
name="multidatatype.SomeEnum",
typeClass = org.eclipse.emf.teneo.hibernate.mapping.ENumUserType,
parameters = {
@Parameter(name="enumClass",
value="test.teneo.multidatatype.SomeEnum")
}
)

You can see this in the attached ECore.
This will generate a typedef looking like:
<typedef name="multidatatype.SomeEnum"
class="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType ">

<param name="enumClass">test.teneo.multidatatype.SomeEnum</param >

</typedef>

My property ends up looking like:

<list name="myProperty" lazy="true" cascade="all,delete-orphan">

<key update="true">

<column name="`someclass_myproperty_e_id`" not-null="true" unique="false"/>

</key>

<list-index column="`someclass_myproperty_idx`"/>

<element type="multidatatype.SomeEnum"/>

</list>

When I try this, I get the exception:
java.lang.ArrayStoreException
at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.jav a:188)
at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:619)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUn ique(NotifyingListImpl.java:323)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:307)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 00)
at test.teneo.MapTests.testSaving(MapTests.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)

The array stored in BasicEList expects an SomeEnum instance and I am passing
in an Integer.
I would like to use the constants in my code like:
someResource.getMyProperty().add(SomeEnum.LIT0);

Instead of having to convert to a SomeEnum everywhere using:

someResource.getMyProperty().add(SomeEnum.get(SomeEnum.LIT0) );

:Let me know if this is not clear.

The only way I have gotten this to work is to use the Teneo
DefaultToStringUserType that I sent in my first message.

Thanks for looking into this.

-mike

"Martin Taal" <mtaal@elver.org> wrote in message
news:f03957$s7a$1@build.eclipse.org...
> Hi Mike,
> Yes seen it.
>
> I am not sure what you with mean with enum annotation? Do you mean the
> typedef?
>
> Teneo also supports enums with dynamic EMF. Here is an example of the
> mapping of a single property if there is no instanceclass:
> <property name="departmentType" lazy="false" not-null="false"
> insert="true" update="true" unique="false">
> <column not-null="false" unique="false" name="`departmenttype`"/>
> <type name="org.eclipse.emf.teneo.hibernate.mapping.DynamicENumUserType ">
> <param name="eclassifier">DepartmentType</param>
> <param name="epackage">http:///www.elver.org/DynamicTest</param>
> </type>
> </property>
>
> Your point regarding osgi is interesting.
> I would think that the issue you mention is larger than just the enum
> class as the classloaderresolver is also used in other locations.
> I have very little experience yet with running in osgi environments (and
> little time on the short term to gain experience). So if you have any
> contributions which would solve this issue (for you) then I am happy to
> look at them and incorporate them.
>
> gr. Martin
>
> Michael Kanaley wrote:
>> Hi Martin,
>> Filed bugzilla number: 182815
>> First question, what exactly should the correct ENum annotation look
>> like?
>> Another general problem with your ENum UserTypes is that they use an
>> enumClass reference.
>> Like you have said before, this does not support dynamic EMF.
>>
>> Also, there is a problem when trying to run Teneo in an OSGi environment.
>> When Teneo attempts to load this class, the ClassLoaderResolver has to be
>> set correctly - which is near impossible in OSGi which means that Teneo
>> has to declare DynamicImport-Package: * to load the ENum attributes.
>>
>> This is not ideal since it binds the class instance to the Teneo plugin
>> so different versions of the same EMF model cannot be used in the same
>> OSGi runtime.
>> Thanks,
>> -mike
>>
>> "Martin Taal" <mtaal@elver.org> wrote in message
>> news:f02ouh$vvd$1@build.eclipse.org...
>>> Hi Mike,
>>> I ran your testcase (thanks) and it fails with me also. With the 0.8.0
>>> release this seems to work but Hibernate serializes the enumerates which
>>> is not the best solution (not queryable, etc.).
>>>
>>> Teneo will add a typedef for an EDataType automatically but not for
>>> enums, also the instanceclass of the edatatype is used in these
>>> auto-created typedefs.
>>> This auto-typedef creation should then also be done for enums (with a
>>> different usertype than the edatatype instanceclass).
>>> Can you enter a bugzilla for this? Then I'll add this.
>>>
>>> Btw, for enumerates the typedef will be different than you propose as
>>> Teneo has a number of default usertypes for enumerates.
>>>
>>> gr. Martin
>>>
>>> Michael Kanaley wrote:
>>>> Hello Martin,
>>>> I have attached a bundle that you can directly import into Eclipse.
>>>> I have removed hibernate and other third party JARs to keep the
>>>> attachment
>>>> small so it will not run until you put all the jars in the lib
>>>> directory.
>>>> It uses HSQLDB and the latest 0.7.5 Teneo.
>>>> I can send you the jars if necessary.
>>>> It will add a launcher called test.teneo.multidatatype.
>>>>
>>>> This model plugin has one class called SomeClass that has a single
>>>> EAttribute called "myProperty" of type SomeEnum that has
>>>> upperbound of -1. Teneo is creating a mapping for this attribute of the
>>>> form:
>>>> <list name="myProperty" lazy="true" cascade="all,delete-orphan">
>>>>
>>>> <key update="true">
>>>>
>>>> <column name="`someclass_myproperty_e_id`" not-null="true"
>>>> unique="false"/>
>>>>
>>>> </key>
>>>>
>>>> <list-index column="`someclass_myproperty_idx`"/>
>>>>
>>>> <element type="test.teneo.multidatatype.SomeEnum"/>
>>>>
>>>> </list>
>>>>
>>>> When I try to persist an instance of this model, the exception at the
>>>> end of this message is
>>>> thrown. Unfortunately, the type should be refering to a typedef instead
>>>> of the custom EDataType class.
>>>> The list mapping should have had an element of the form:
>>>> <element type="multidatatype.SomeEnum"/>
>>>>
>>>> The typedef multidatatype.SomeEnum should have been declared like:
>>>> <typedef name="multidatatype.SomeEnum"
>>>> class=" org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype ">
>>>>
>>>> <param
>>>> name="epackage">http://xsd.example.org/test/multidatatype</param>
>>>>
>>>> <param name="edatatype">SomeEnum</param>
>>>>
>>>> </typedef>
>>>>
>>>>
>>>> Fortunately, there is a simple workaround by declaring an annotation on
>>>> the SomeEnum EDataType of the form:
>>>> @TypeDef(
>>>> name="multidatatype.SomeEnum",
>>>> typeClass =
>>>> org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype,
>>>> parameters = {
>>>> @Parameter(name="epackage",
>>>> value="http://xsd.example.org/test/multidatatype")
>>>> @Parameter(name="edatatype", value="SomeEnum")
>>>> }
>>>> )
>>>>
>>>> Please let me know if this is considered a bug and I will file a
>>>> bugzilla.
>>>> Thanks,
>>>> -mike
>>>>
>>>> org.hibernate.MappingException: Could not determine type for:
>>>> test.teneo.multidatatype.SomeEnum, for columns:
>>>> [org.hibernate.mapping.Column(elt)]
>>>>
>>>> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>>>>
>>>> at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:138)
>>>>
>>>> at org.hibernate.mapping.Column.getSqlType(Column.java:182)
>>>>
>>>> at org.hibernate.mapping.Table.sqlCreateString(Table.java:383)
>>>>
>>>> at
>>>> org.hibernate.cfg.Configuration.generateSchemaUpdateScript(C onfiguration.java:884)
>>>>
>>>> at
>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:140)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:478)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:180)
>>>>
>>>> at test.teneo.MapTests.createHbDataStore(MapTests.java:72)
>>>>
>>>> at test.teneo.MapTests.testSaving(MapTests.java:86)
>>>>
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>
>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>
>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>
>>>> at junit.framework.TestCase.runTest(TestCase.java:154)
>>>>
>>>> at junit.framework.TestCase.runBare(TestCase.java:127)
>>>>
>>>> at junit.framework.TestResult$1.protect(TestResult.java:106)
>>>>
>>>> at junit.framework.TestResult.runProtected(TestResult.java:124)
>>>>
>>>> at junit.framework.TestResult.run(TestResult.java:109)
>>>>
>>>> at junit.framework.TestCase.run(TestCase.java:118)
>>>>
>>>> at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>>
>>>> at junit.framework.TestSuite.run(TestSuite.java:203)
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:128)
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>>>>
>>>>
>>>
>>> --
>>>
>>> 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
>>
>>
>
>
> --
>
> 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] Multivalued EAttributes of EDataTypes do not have the correct Hibernate mapping [message #80203 is a reply to message #80186] Tue, 17 April 2007 21:48 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mike,
This is an emf feature and not a Teneo issue. I had the same exception with the testcase which you
send and had to change to:
someResource.getMyProperty().add(SomeEnum.LIT0_LITERAL);

So instead of SomeEnum.LIT0 you can get the literal directly through: SomeEnum.LIT0_LITERAL.

Emf internally makes the lists typesafe (also in case of jdk 1.4). It expects therefore that you add
an actual instance of the enum to the list and not the integer constant.

gr. Martin

Michael Kanaley wrote:
> Hi Martin,
>> I am not sure what you with mean with enum annotation? Do you mean the
>> typedef?
> I have defined the following annotation on the EEnum:
> @TypeDef(
> name="multidatatype.SomeEnum",
> typeClass = org.eclipse.emf.teneo.hibernate.mapping.ENumUserType,
> parameters = {
> @Parameter(name="enumClass",
> value="test.teneo.multidatatype.SomeEnum")
> }
> )
>
> You can see this in the attached ECore.
> This will generate a typedef looking like:
> <typedef name="multidatatype.SomeEnum"
> class="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType ">
>
> <param name="enumClass">test.teneo.multidatatype.SomeEnum</param >
>
> </typedef>
>
> My property ends up looking like:
>
> <list name="myProperty" lazy="true" cascade="all,delete-orphan">
>
> <key update="true">
>
> <column name="`someclass_myproperty_e_id`" not-null="true" unique="false"/>
>
> </key>
>
> <list-index column="`someclass_myproperty_idx`"/>
>
> <element type="multidatatype.SomeEnum"/>
>
> </list>
>
> When I try this, I get the exception:
> java.lang.ArrayStoreException
> at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.jav a:188)
> at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:619)
> at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUn ique(NotifyingListImpl.java:323)
> at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:307)
> at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 00)
> at test.teneo.MapTests.testSaving(MapTests.java:93)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at junit.framework.TestCase.runTest(TestCase.java:154)
>
> The array stored in BasicEList expects an SomeEnum instance and I am passing
> in an Integer.
> I would like to use the constants in my code like:
> someResource.getMyProperty().add(SomeEnum.LIT0);
>
> Instead of having to convert to a SomeEnum everywhere using:
>
> someResource.getMyProperty().add(SomeEnum.get(SomeEnum.LIT0) );
>
> :Let me know if this is not clear.
>
> The only way I have gotten this to work is to use the Teneo
> DefaultToStringUserType that I sent in my first message.
>
> Thanks for looking into this.
>
> -mike
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:f03957$s7a$1@build.eclipse.org...
>> Hi Mike,
>> Yes seen it.
>>
>> I am not sure what you with mean with enum annotation? Do you mean the
>> typedef?
>>
>> Teneo also supports enums with dynamic EMF. Here is an example of the
>> mapping of a single property if there is no instanceclass:
>> <property name="departmentType" lazy="false" not-null="false"
>> insert="true" update="true" unique="false">
>> <column not-null="false" unique="false" name="`departmenttype`"/>
>> <type name="org.eclipse.emf.teneo.hibernate.mapping.DynamicENumUserType ">
>> <param name="eclassifier">DepartmentType</param>
>> <param name="epackage">http:///www.elver.org/DynamicTest</param>
>> </type>
>> </property>
>>
>> Your point regarding osgi is interesting.
>> I would think that the issue you mention is larger than just the enum
>> class as the classloaderresolver is also used in other locations.
>> I have very little experience yet with running in osgi environments (and
>> little time on the short term to gain experience). So if you have any
>> contributions which would solve this issue (for you) then I am happy to
>> look at them and incorporate them.
>>
>> gr. Martin
>>
>> Michael Kanaley wrote:
>>> Hi Martin,
>>> Filed bugzilla number: 182815
>>> First question, what exactly should the correct ENum annotation look
>>> like?
>>> Another general problem with your ENum UserTypes is that they use an
>>> enumClass reference.
>>> Like you have said before, this does not support dynamic EMF.
>>>
>>> Also, there is a problem when trying to run Teneo in an OSGi environment.
>>> When Teneo attempts to load this class, the ClassLoaderResolver has to be
>>> set correctly - which is near impossible in OSGi which means that Teneo
>>> has to declare DynamicImport-Package: * to load the ENum attributes.
>>>
>>> This is not ideal since it binds the class instance to the Teneo plugin
>>> so different versions of the same EMF model cannot be used in the same
>>> OSGi runtime.
>>> Thanks,
>>> -mike
>>>
>>> "Martin Taal" <mtaal@elver.org> wrote in message
>>> news:f02ouh$vvd$1@build.eclipse.org...
>>>> Hi Mike,
>>>> I ran your testcase (thanks) and it fails with me also. With the 0.8.0
>>>> release this seems to work but Hibernate serializes the enumerates which
>>>> is not the best solution (not queryable, etc.).
>>>>
>>>> Teneo will add a typedef for an EDataType automatically but not for
>>>> enums, also the instanceclass of the edatatype is used in these
>>>> auto-created typedefs.
>>>> This auto-typedef creation should then also be done for enums (with a
>>>> different usertype than the edatatype instanceclass).
>>>> Can you enter a bugzilla for this? Then I'll add this.
>>>>
>>>> Btw, for enumerates the typedef will be different than you propose as
>>>> Teneo has a number of default usertypes for enumerates.
>>>>
>>>> gr. Martin
>>>>
>>>> Michael Kanaley wrote:
>>>>> Hello Martin,
>>>>> I have attached a bundle that you can directly import into Eclipse.
>>>>> I have removed hibernate and other third party JARs to keep the
>>>>> attachment
>>>>> small so it will not run until you put all the jars in the lib
>>>>> directory.
>>>>> It uses HSQLDB and the latest 0.7.5 Teneo.
>>>>> I can send you the jars if necessary.
>>>>> It will add a launcher called test.teneo.multidatatype.
>>>>>
>>>>> This model plugin has one class called SomeClass that has a single
>>>>> EAttribute called "myProperty" of type SomeEnum that has
>>>>> upperbound of -1. Teneo is creating a mapping for this attribute of the
>>>>> form:
>>>>> <list name="myProperty" lazy="true" cascade="all,delete-orphan">
>>>>>
>>>>> <key update="true">
>>>>>
>>>>> <column name="`someclass_myproperty_e_id`" not-null="true"
>>>>> unique="false"/>
>>>>>
>>>>> </key>
>>>>>
>>>>> <list-index column="`someclass_myproperty_idx`"/>
>>>>>
>>>>> <element type="test.teneo.multidatatype.SomeEnum"/>
>>>>>
>>>>> </list>
>>>>>
>>>>> When I try to persist an instance of this model, the exception at the
>>>>> end of this message is
>>>>> thrown. Unfortunately, the type should be refering to a typedef instead
>>>>> of the custom EDataType class.
>>>>> The list mapping should have had an element of the form:
>>>>> <element type="multidatatype.SomeEnum"/>
>>>>>
>>>>> The typedef multidatatype.SomeEnum should have been declared like:
>>>>> <typedef name="multidatatype.SomeEnum"
>>>>> class=" org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype ">
>>>>>
>>>>> <param
>>>>> name="epackage">http://xsd.example.org/test/multidatatype</param>
>>>>>
>>>>> <param name="edatatype">SomeEnum</param>
>>>>>
>>>>> </typedef>
>>>>>
>>>>>
>>>>> Fortunately, there is a simple workaround by declaring an annotation on
>>>>> the SomeEnum EDataType of the form:
>>>>> @TypeDef(
>>>>> name="multidatatype.SomeEnum",
>>>>> typeClass =
>>>>> org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype,
>>>>> parameters = {
>>>>> @Parameter(name="epackage",
>>>>> value="http://xsd.example.org/test/multidatatype")
>>>>> @Parameter(name="edatatype", value="SomeEnum")
>>>>> }
>>>>> )
>>>>>
>>>>> Please let me know if this is considered a bug and I will file a
>>>>> bugzilla.
>>>>> Thanks,
>>>>> -mike
>>>>>
>>>>> org.hibernate.MappingException: Could not determine type for:
>>>>> test.teneo.multidatatype.SomeEnum, for columns:
>>>>> [org.hibernate.mapping.Column(elt)]
>>>>>
>>>>> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>>>>>
>>>>> at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:138)
>>>>>
>>>>> at org.hibernate.mapping.Column.getSqlType(Column.java:182)
>>>>>
>>>>> at org.hibernate.mapping.Table.sqlCreateString(Table.java:383)
>>>>>
>>>>> at
>>>>> org.hibernate.cfg.Configuration.generateSchemaUpdateScript(C onfiguration.java:884)
>>>>>
>>>>> at
>>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:140)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:478)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:180)
>>>>>
>>>>> at test.teneo.MapTests.createHbDataStore(MapTests.java:72)
>>>>>
>>>>> at test.teneo.MapTests.testSaving(MapTests.java:86)
>>>>>
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>>
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>>
>>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>>
>>>>> at junit.framework.TestCase.runTest(TestCase.java:154)
>>>>>
>>>>> at junit.framework.TestCase.runBare(TestCase.java:127)
>>>>>
>>>>> at junit.framework.TestResult$1.protect(TestResult.java:106)
>>>>>
>>>>> at junit.framework.TestResult.runProtected(TestResult.java:124)
>>>>>
>>>>> at junit.framework.TestResult.run(TestResult.java:109)
>>>>>
>>>>> at junit.framework.TestCase.run(TestCase.java:118)
>>>>>
>>>>> at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>>>
>>>>> at junit.framework.TestSuite.run(TestSuite.java:203)
>>>>>
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:128)
>>>>>
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>>>>
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>>>>
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>>>>
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>>>>
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>>>>>
>>>>>
>>>> --
>>>>
>>>> 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
>>>
>>
>> --
>>
>> 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
>
>


--

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] Multivalued EAttributes of EDataTypes do not have the correct Hibernate mapping [message #604785 is a reply to message #79974] Tue, 17 April 2007 15:26 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mike,
I ran your testcase (thanks) and it fails with me also. With the 0.8.0 release this seems to work
but Hibernate serializes the enumerates which is not the best solution (not queryable, etc.).

Teneo will add a typedef for an EDataType automatically but not for enums, also the instanceclass of
the edatatype is used in these auto-created typedefs.
This auto-typedef creation should then also be done for enums (with a different usertype than the
edatatype instanceclass).
Can you enter a bugzilla for this? Then I'll add this.

Btw, for enumerates the typedef will be different than you propose as Teneo has a number of default
usertypes for enumerates.

gr. Martin

Michael Kanaley wrote:
> Hello Martin,
> I have attached a bundle that you can directly import into Eclipse.
> I have removed hibernate and other third party JARs to keep the attachment
> small so it will not run until you put all the jars in the lib directory.
> It uses HSQLDB and the latest 0.7.5 Teneo.
> I can send you the jars if necessary.
> It will add a launcher called test.teneo.multidatatype.
>
> This model plugin has one class called SomeClass that has a single
> EAttribute called "myProperty" of type SomeEnum that has
> upperbound of -1. Teneo is creating a mapping for this attribute of the
> form:
> <list name="myProperty" lazy="true" cascade="all,delete-orphan">
>
> <key update="true">
>
> <column name="`someclass_myproperty_e_id`" not-null="true" unique="false"/>
>
> </key>
>
> <list-index column="`someclass_myproperty_idx`"/>
>
> <element type="test.teneo.multidatatype.SomeEnum"/>
>
> </list>
>
> When I try to persist an instance of this model, the exception at the end of
> this message is
> thrown. Unfortunately, the type should be refering to a typedef instead of
> the custom EDataType class.
> The list mapping should have had an element of the form:
> <element type="multidatatype.SomeEnum"/>
>
> The typedef multidatatype.SomeEnum should have been declared like:
> <typedef name="multidatatype.SomeEnum"
> class=" org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype ">
>
> <param
> name="epackage">http://xsd.example.org/test/multidatatype</param>
>
> <param name="edatatype">SomeEnum</param>
>
> </typedef>
>
>
> Fortunately, there is a simple workaround by declaring an annotation on the
> SomeEnum EDataType of the form:
> @TypeDef(
> name="multidatatype.SomeEnum",
> typeClass =
> org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype,
> parameters = {
> @Parameter(name="epackage",
> value="http://xsd.example.org/test/multidatatype")
> @Parameter(name="edatatype", value="SomeEnum")
> }
> )
>
> Please let me know if this is considered a bug and I will file a bugzilla.
> Thanks,
> -mike
>
> org.hibernate.MappingException: Could not determine type for:
> test.teneo.multidatatype.SomeEnum, for columns:
> [org.hibernate.mapping.Column(elt)]
>
> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>
> at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:138)
>
> at org.hibernate.mapping.Column.getSqlType(Column.java:182)
>
> at org.hibernate.mapping.Table.sqlCreateString(Table.java:383)
>
> at
> org.hibernate.cfg.Configuration.generateSchemaUpdateScript(C onfiguration.java:884)
>
> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:140)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:478)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:180)
>
> at test.teneo.MapTests.createHbDataStore(MapTests.java:72)
>
> at test.teneo.MapTests.testSaving(MapTests.java:86)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>
> at java.lang.reflect.Method.invoke(Unknown Source)
>
> at junit.framework.TestCase.runTest(TestCase.java:154)
>
> at junit.framework.TestCase.runBare(TestCase.java:127)
>
> at junit.framework.TestResult$1.protect(TestResult.java:106)
>
> at junit.framework.TestResult.runProtected(TestResult.java:124)
>
> at junit.framework.TestResult.run(TestResult.java:109)
>
> at junit.framework.TestCase.run(TestCase.java:118)
>
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
>
> at junit.framework.TestSuite.run(TestSuite.java:203)
>
> at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:128)
>
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>
>


--

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] Multivalued EAttributes of EDataTypes do not have the correct Hibernate mapping [message #604810 is a reply to message #80040] Tue, 17 April 2007 19:30 Go to previous message
Michael Kanaley is currently offline Michael KanaleyFriend
Messages: 89
Registered: July 2009
Member
Hi Martin,
Filed bugzilla number: 182815
First question, what exactly should the correct ENum annotation look like?
Another general problem with your ENum UserTypes is that they use an
enumClass reference.
Like you have said before, this does not support dynamic EMF.

Also, there is a problem when trying to run Teneo in an OSGi environment.
When Teneo attempts to load this class, the ClassLoaderResolver has to be
set correctly - which is near impossible in OSGi which means that Teneo has
to declare DynamicImport-Package: * to load the ENum attributes.

This is not ideal since it binds the class instance to the Teneo plugin so
different versions of the same EMF model cannot be used in the same OSGi
runtime.
Thanks,
-mike

"Martin Taal" <mtaal@elver.org> wrote in message
news:f02ouh$vvd$1@build.eclipse.org...
> Hi Mike,
> I ran your testcase (thanks) and it fails with me also. With the 0.8.0
> release this seems to work but Hibernate serializes the enumerates which
> is not the best solution (not queryable, etc.).
>
> Teneo will add a typedef for an EDataType automatically but not for enums,
> also the instanceclass of the edatatype is used in these auto-created
> typedefs.
> This auto-typedef creation should then also be done for enums (with a
> different usertype than the edatatype instanceclass).
> Can you enter a bugzilla for this? Then I'll add this.
>
> Btw, for enumerates the typedef will be different than you propose as
> Teneo has a number of default usertypes for enumerates.
>
> gr. Martin
>
> Michael Kanaley wrote:
>> Hello Martin,
>> I have attached a bundle that you can directly import into Eclipse.
>> I have removed hibernate and other third party JARs to keep the
>> attachment
>> small so it will not run until you put all the jars in the lib directory.
>> It uses HSQLDB and the latest 0.7.5 Teneo.
>> I can send you the jars if necessary.
>> It will add a launcher called test.teneo.multidatatype.
>>
>> This model plugin has one class called SomeClass that has a single
>> EAttribute called "myProperty" of type SomeEnum that has
>> upperbound of -1. Teneo is creating a mapping for this attribute of the
>> form:
>> <list name="myProperty" lazy="true" cascade="all,delete-orphan">
>>
>> <key update="true">
>>
>> <column name="`someclass_myproperty_e_id`" not-null="true"
>> unique="false"/>
>>
>> </key>
>>
>> <list-index column="`someclass_myproperty_idx`"/>
>>
>> <element type="test.teneo.multidatatype.SomeEnum"/>
>>
>> </list>
>>
>> When I try to persist an instance of this model, the exception at the end
>> of this message is
>> thrown. Unfortunately, the type should be refering to a typedef instead
>> of the custom EDataType class.
>> The list mapping should have had an element of the form:
>> <element type="multidatatype.SomeEnum"/>
>>
>> The typedef multidatatype.SomeEnum should have been declared like:
>> <typedef name="multidatatype.SomeEnum"
>> class=" org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype ">
>>
>> <param
>> name="epackage">http://xsd.example.org/test/multidatatype</param>
>>
>> <param name="edatatype">SomeEnum</param>
>>
>> </typedef>
>>
>>
>> Fortunately, there is a simple workaround by declaring an annotation on
>> the SomeEnum EDataType of the form:
>> @TypeDef(
>> name="multidatatype.SomeEnum",
>> typeClass =
>> org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype,
>> parameters = {
>> @Parameter(name="epackage",
>> value="http://xsd.example.org/test/multidatatype")
>> @Parameter(name="edatatype", value="SomeEnum")
>> }
>> )
>>
>> Please let me know if this is considered a bug and I will file a
>> bugzilla.
>> Thanks,
>> -mike
>>
>> org.hibernate.MappingException: Could not determine type for:
>> test.teneo.multidatatype.SomeEnum, for columns:
>> [org.hibernate.mapping.Column(elt)]
>>
>> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>>
>> at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:138)
>>
>> at org.hibernate.mapping.Column.getSqlType(Column.java:182)
>>
>> at org.hibernate.mapping.Table.sqlCreateString(Table.java:383)
>>
>> at
>> org.hibernate.cfg.Configuration.generateSchemaUpdateScript(C onfiguration.java:884)
>>
>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:140)
>>
>> at
>> org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:478)
>>
>> at
>> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:180)
>>
>> at test.teneo.MapTests.createHbDataStore(MapTests.java:72)
>>
>> at test.teneo.MapTests.testSaving(MapTests.java:86)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>
>> at java.lang.reflect.Method.invoke(Unknown Source)
>>
>> at junit.framework.TestCase.runTest(TestCase.java:154)
>>
>> at junit.framework.TestCase.runBare(TestCase.java:127)
>>
>> at junit.framework.TestResult$1.protect(TestResult.java:106)
>>
>> at junit.framework.TestResult.runProtected(TestResult.java:124)
>>
>> at junit.framework.TestResult.run(TestResult.java:109)
>>
>> at junit.framework.TestCase.run(TestCase.java:118)
>>
>> at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>
>> at junit.framework.TestSuite.run(TestSuite.java:203)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:128)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>>
>>
>
>
> --
>
> 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] Multivalued EAttributes of EDataTypes do not have the correct Hibernate mapping [message #604813 is a reply to message #80126] Tue, 17 April 2007 20:02 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mike,
Yes seen it.

I am not sure what you with mean with enum annotation? Do you mean the typedef?

Teneo also supports enums with dynamic EMF. Here is an example of the mapping of a single property
if there is no instanceclass:
<property name="departmentType" lazy="false" not-null="false" insert="true" update="true"
unique="false">
<column not-null="false" unique="false" name="`departmenttype`"/>
<type name="org.eclipse.emf.teneo.hibernate.mapping.DynamicENumUserType ">
<param name="eclassifier">DepartmentType</param>
<param name="epackage">http:///www.elver.org/DynamicTest</param>
</type>
</property>

Your point regarding osgi is interesting.
I would think that the issue you mention is larger than just the enum class as the
classloaderresolver is also used in other locations.
I have very little experience yet with running in osgi environments (and little time on the short
term to gain experience). So if you have any contributions which would solve this issue (for you)
then I am happy to look at them and incorporate them.

gr. Martin

Michael Kanaley wrote:
> Hi Martin,
> Filed bugzilla number: 182815
> First question, what exactly should the correct ENum annotation look like?
> Another general problem with your ENum UserTypes is that they use an
> enumClass reference.
> Like you have said before, this does not support dynamic EMF.
>
> Also, there is a problem when trying to run Teneo in an OSGi environment.
> When Teneo attempts to load this class, the ClassLoaderResolver has to be
> set correctly - which is near impossible in OSGi which means that Teneo has
> to declare DynamicImport-Package: * to load the ENum attributes.
>
> This is not ideal since it binds the class instance to the Teneo plugin so
> different versions of the same EMF model cannot be used in the same OSGi
> runtime.
> Thanks,
> -mike
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:f02ouh$vvd$1@build.eclipse.org...
>> Hi Mike,
>> I ran your testcase (thanks) and it fails with me also. With the 0.8.0
>> release this seems to work but Hibernate serializes the enumerates which
>> is not the best solution (not queryable, etc.).
>>
>> Teneo will add a typedef for an EDataType automatically but not for enums,
>> also the instanceclass of the edatatype is used in these auto-created
>> typedefs.
>> This auto-typedef creation should then also be done for enums (with a
>> different usertype than the edatatype instanceclass).
>> Can you enter a bugzilla for this? Then I'll add this.
>>
>> Btw, for enumerates the typedef will be different than you propose as
>> Teneo has a number of default usertypes for enumerates.
>>
>> gr. Martin
>>
>> Michael Kanaley wrote:
>>> Hello Martin,
>>> I have attached a bundle that you can directly import into Eclipse.
>>> I have removed hibernate and other third party JARs to keep the
>>> attachment
>>> small so it will not run until you put all the jars in the lib directory.
>>> It uses HSQLDB and the latest 0.7.5 Teneo.
>>> I can send you the jars if necessary.
>>> It will add a launcher called test.teneo.multidatatype.
>>>
>>> This model plugin has one class called SomeClass that has a single
>>> EAttribute called "myProperty" of type SomeEnum that has
>>> upperbound of -1. Teneo is creating a mapping for this attribute of the
>>> form:
>>> <list name="myProperty" lazy="true" cascade="all,delete-orphan">
>>>
>>> <key update="true">
>>>
>>> <column name="`someclass_myproperty_e_id`" not-null="true"
>>> unique="false"/>
>>>
>>> </key>
>>>
>>> <list-index column="`someclass_myproperty_idx`"/>
>>>
>>> <element type="test.teneo.multidatatype.SomeEnum"/>
>>>
>>> </list>
>>>
>>> When I try to persist an instance of this model, the exception at the end
>>> of this message is
>>> thrown. Unfortunately, the type should be refering to a typedef instead
>>> of the custom EDataType class.
>>> The list mapping should have had an element of the form:
>>> <element type="multidatatype.SomeEnum"/>
>>>
>>> The typedef multidatatype.SomeEnum should have been declared like:
>>> <typedef name="multidatatype.SomeEnum"
>>> class=" org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype ">
>>>
>>> <param
>>> name="epackage">http://xsd.example.org/test/multidatatype</param>
>>>
>>> <param name="edatatype">SomeEnum</param>
>>>
>>> </typedef>
>>>
>>>
>>> Fortunately, there is a simple workaround by declaring an annotation on
>>> the SomeEnum EDataType of the form:
>>> @TypeDef(
>>> name="multidatatype.SomeEnum",
>>> typeClass =
>>> org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype,
>>> parameters = {
>>> @Parameter(name="epackage",
>>> value="http://xsd.example.org/test/multidatatype")
>>> @Parameter(name="edatatype", value="SomeEnum")
>>> }
>>> )
>>>
>>> Please let me know if this is considered a bug and I will file a
>>> bugzilla.
>>> Thanks,
>>> -mike
>>>
>>> org.hibernate.MappingException: Could not determine type for:
>>> test.teneo.multidatatype.SomeEnum, for columns:
>>> [org.hibernate.mapping.Column(elt)]
>>>
>>> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>>>
>>> at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:138)
>>>
>>> at org.hibernate.mapping.Column.getSqlType(Column.java:182)
>>>
>>> at org.hibernate.mapping.Table.sqlCreateString(Table.java:383)
>>>
>>> at
>>> org.hibernate.cfg.Configuration.generateSchemaUpdateScript(C onfiguration.java:884)
>>>
>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:140)
>>>
>>> at
>>> org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:478)
>>>
>>> at
>>> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:180)
>>>
>>> at test.teneo.MapTests.createHbDataStore(MapTests.java:72)
>>>
>>> at test.teneo.MapTests.testSaving(MapTests.java:86)
>>>
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>
>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>
>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>
>>> at junit.framework.TestCase.runTest(TestCase.java:154)
>>>
>>> at junit.framework.TestCase.runBare(TestCase.java:127)
>>>
>>> at junit.framework.TestResult$1.protect(TestResult.java:106)
>>>
>>> at junit.framework.TestResult.runProtected(TestResult.java:124)
>>>
>>> at junit.framework.TestResult.run(TestResult.java:109)
>>>
>>> at junit.framework.TestCase.run(TestCase.java:118)
>>>
>>> at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>
>>> at junit.framework.TestSuite.run(TestSuite.java:203)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:128)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>>
>>> at
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>>>
>>>
>>
>> --
>>
>> 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
>
>


--

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] Multivalued EAttributes of EDataTypes do not have the correct Hibernate mapping [message #604820 is a reply to message #80142] Tue, 17 April 2007 21:30 Go to previous message
Michael Kanaley is currently offline Michael KanaleyFriend
Messages: 89
Registered: July 2009
Member
Hi Martin,
> I am not sure what you with mean with enum annotation? Do you mean the
> typedef?
I have defined the following annotation on the EEnum:
@TypeDef(
name="multidatatype.SomeEnum",
typeClass = org.eclipse.emf.teneo.hibernate.mapping.ENumUserType,
parameters = {
@Parameter(name="enumClass",
value="test.teneo.multidatatype.SomeEnum")
}
)

You can see this in the attached ECore.
This will generate a typedef looking like:
<typedef name="multidatatype.SomeEnum"
class="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType ">

<param name="enumClass">test.teneo.multidatatype.SomeEnum</param >

</typedef>

My property ends up looking like:

<list name="myProperty" lazy="true" cascade="all,delete-orphan">

<key update="true">

<column name="`someclass_myproperty_e_id`" not-null="true" unique="false"/>

</key>

<list-index column="`someclass_myproperty_idx`"/>

<element type="multidatatype.SomeEnum"/>

</list>

When I try this, I get the exception:
java.lang.ArrayStoreException
at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.jav a:188)
at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:619)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUn ique(NotifyingListImpl.java:323)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:307)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 00)
at test.teneo.MapTests.testSaving(MapTests.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)

The array stored in BasicEList expects an SomeEnum instance and I am passing
in an Integer.
I would like to use the constants in my code like:
someResource.getMyProperty().add(SomeEnum.LIT0);

Instead of having to convert to a SomeEnum everywhere using:

someResource.getMyProperty().add(SomeEnum.get(SomeEnum.LIT0) );

:Let me know if this is not clear.

The only way I have gotten this to work is to use the Teneo
DefaultToStringUserType that I sent in my first message.

Thanks for looking into this.

-mike

"Martin Taal" <mtaal@elver.org> wrote in message
news:f03957$s7a$1@build.eclipse.org...
> Hi Mike,
> Yes seen it.
>
> I am not sure what you with mean with enum annotation? Do you mean the
> typedef?
>
> Teneo also supports enums with dynamic EMF. Here is an example of the
> mapping of a single property if there is no instanceclass:
> <property name="departmentType" lazy="false" not-null="false"
> insert="true" update="true" unique="false">
> <column not-null="false" unique="false" name="`departmenttype`"/>
> <type name="org.eclipse.emf.teneo.hibernate.mapping.DynamicENumUserType ">
> <param name="eclassifier">DepartmentType</param>
> <param name="epackage">http:///www.elver.org/DynamicTest</param>
> </type>
> </property>
>
> Your point regarding osgi is interesting.
> I would think that the issue you mention is larger than just the enum
> class as the classloaderresolver is also used in other locations.
> I have very little experience yet with running in osgi environments (and
> little time on the short term to gain experience). So if you have any
> contributions which would solve this issue (for you) then I am happy to
> look at them and incorporate them.
>
> gr. Martin
>
> Michael Kanaley wrote:
>> Hi Martin,
>> Filed bugzilla number: 182815
>> First question, what exactly should the correct ENum annotation look
>> like?
>> Another general problem with your ENum UserTypes is that they use an
>> enumClass reference.
>> Like you have said before, this does not support dynamic EMF.
>>
>> Also, there is a problem when trying to run Teneo in an OSGi environment.
>> When Teneo attempts to load this class, the ClassLoaderResolver has to be
>> set correctly - which is near impossible in OSGi which means that Teneo
>> has to declare DynamicImport-Package: * to load the ENum attributes.
>>
>> This is not ideal since it binds the class instance to the Teneo plugin
>> so different versions of the same EMF model cannot be used in the same
>> OSGi runtime.
>> Thanks,
>> -mike
>>
>> "Martin Taal" <mtaal@elver.org> wrote in message
>> news:f02ouh$vvd$1@build.eclipse.org...
>>> Hi Mike,
>>> I ran your testcase (thanks) and it fails with me also. With the 0.8.0
>>> release this seems to work but Hibernate serializes the enumerates which
>>> is not the best solution (not queryable, etc.).
>>>
>>> Teneo will add a typedef for an EDataType automatically but not for
>>> enums, also the instanceclass of the edatatype is used in these
>>> auto-created typedefs.
>>> This auto-typedef creation should then also be done for enums (with a
>>> different usertype than the edatatype instanceclass).
>>> Can you enter a bugzilla for this? Then I'll add this.
>>>
>>> Btw, for enumerates the typedef will be different than you propose as
>>> Teneo has a number of default usertypes for enumerates.
>>>
>>> gr. Martin
>>>
>>> Michael Kanaley wrote:
>>>> Hello Martin,
>>>> I have attached a bundle that you can directly import into Eclipse.
>>>> I have removed hibernate and other third party JARs to keep the
>>>> attachment
>>>> small so it will not run until you put all the jars in the lib
>>>> directory.
>>>> It uses HSQLDB and the latest 0.7.5 Teneo.
>>>> I can send you the jars if necessary.
>>>> It will add a launcher called test.teneo.multidatatype.
>>>>
>>>> This model plugin has one class called SomeClass that has a single
>>>> EAttribute called "myProperty" of type SomeEnum that has
>>>> upperbound of -1. Teneo is creating a mapping for this attribute of the
>>>> form:
>>>> <list name="myProperty" lazy="true" cascade="all,delete-orphan">
>>>>
>>>> <key update="true">
>>>>
>>>> <column name="`someclass_myproperty_e_id`" not-null="true"
>>>> unique="false"/>
>>>>
>>>> </key>
>>>>
>>>> <list-index column="`someclass_myproperty_idx`"/>
>>>>
>>>> <element type="test.teneo.multidatatype.SomeEnum"/>
>>>>
>>>> </list>
>>>>
>>>> When I try to persist an instance of this model, the exception at the
>>>> end of this message is
>>>> thrown. Unfortunately, the type should be refering to a typedef instead
>>>> of the custom EDataType class.
>>>> The list mapping should have had an element of the form:
>>>> <element type="multidatatype.SomeEnum"/>
>>>>
>>>> The typedef multidatatype.SomeEnum should have been declared like:
>>>> <typedef name="multidatatype.SomeEnum"
>>>> class=" org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype ">
>>>>
>>>> <param
>>>> name="epackage">http://xsd.example.org/test/multidatatype</param>
>>>>
>>>> <param name="edatatype">SomeEnum</param>
>>>>
>>>> </typedef>
>>>>
>>>>
>>>> Fortunately, there is a simple workaround by declaring an annotation on
>>>> the SomeEnum EDataType of the form:
>>>> @TypeDef(
>>>> name="multidatatype.SomeEnum",
>>>> typeClass =
>>>> org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype,
>>>> parameters = {
>>>> @Parameter(name="epackage",
>>>> value="http://xsd.example.org/test/multidatatype")
>>>> @Parameter(name="edatatype", value="SomeEnum")
>>>> }
>>>> )
>>>>
>>>> Please let me know if this is considered a bug and I will file a
>>>> bugzilla.
>>>> Thanks,
>>>> -mike
>>>>
>>>> org.hibernate.MappingException: Could not determine type for:
>>>> test.teneo.multidatatype.SomeEnum, for columns:
>>>> [org.hibernate.mapping.Column(elt)]
>>>>
>>>> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>>>>
>>>> at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:138)
>>>>
>>>> at org.hibernate.mapping.Column.getSqlType(Column.java:182)
>>>>
>>>> at org.hibernate.mapping.Table.sqlCreateString(Table.java:383)
>>>>
>>>> at
>>>> org.hibernate.cfg.Configuration.generateSchemaUpdateScript(C onfiguration.java:884)
>>>>
>>>> at
>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:140)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:478)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:180)
>>>>
>>>> at test.teneo.MapTests.createHbDataStore(MapTests.java:72)
>>>>
>>>> at test.teneo.MapTests.testSaving(MapTests.java:86)
>>>>
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>
>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>
>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>
>>>> at junit.framework.TestCase.runTest(TestCase.java:154)
>>>>
>>>> at junit.framework.TestCase.runBare(TestCase.java:127)
>>>>
>>>> at junit.framework.TestResult$1.protect(TestResult.java:106)
>>>>
>>>> at junit.framework.TestResult.runProtected(TestResult.java:124)
>>>>
>>>> at junit.framework.TestResult.run(TestResult.java:109)
>>>>
>>>> at junit.framework.TestCase.run(TestCase.java:118)
>>>>
>>>> at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>>
>>>> at junit.framework.TestSuite.run(TestSuite.java:203)
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:128)
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>>>
>>>> at
>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>>>>
>>>>
>>>
>>> --
>>>
>>> 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
>>
>>
>
>
> --
>
> 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] Multivalued EAttributes of EDataTypes do not have the correct Hibernate mapping [message #604823 is a reply to message #80186] Tue, 17 April 2007 21:48 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mike,
This is an emf feature and not a Teneo issue. I had the same exception with the testcase which you
send and had to change to:
someResource.getMyProperty().add(SomeEnum.LIT0_LITERAL);

So instead of SomeEnum.LIT0 you can get the literal directly through: SomeEnum.LIT0_LITERAL.

Emf internally makes the lists typesafe (also in case of jdk 1.4). It expects therefore that you add
an actual instance of the enum to the list and not the integer constant.

gr. Martin

Michael Kanaley wrote:
> Hi Martin,
>> I am not sure what you with mean with enum annotation? Do you mean the
>> typedef?
> I have defined the following annotation on the EEnum:
> @TypeDef(
> name="multidatatype.SomeEnum",
> typeClass = org.eclipse.emf.teneo.hibernate.mapping.ENumUserType,
> parameters = {
> @Parameter(name="enumClass",
> value="test.teneo.multidatatype.SomeEnum")
> }
> )
>
> You can see this in the attached ECore.
> This will generate a typedef looking like:
> <typedef name="multidatatype.SomeEnum"
> class="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType ">
>
> <param name="enumClass">test.teneo.multidatatype.SomeEnum</param >
>
> </typedef>
>
> My property ends up looking like:
>
> <list name="myProperty" lazy="true" cascade="all,delete-orphan">
>
> <key update="true">
>
> <column name="`someclass_myproperty_e_id`" not-null="true" unique="false"/>
>
> </key>
>
> <list-index column="`someclass_myproperty_idx`"/>
>
> <element type="multidatatype.SomeEnum"/>
>
> </list>
>
> When I try this, I get the exception:
> java.lang.ArrayStoreException
> at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.jav a:188)
> at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:619)
> at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUn ique(NotifyingListImpl.java:323)
> at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:307)
> at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:6 00)
> at test.teneo.MapTests.testSaving(MapTests.java:93)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at junit.framework.TestCase.runTest(TestCase.java:154)
>
> The array stored in BasicEList expects an SomeEnum instance and I am passing
> in an Integer.
> I would like to use the constants in my code like:
> someResource.getMyProperty().add(SomeEnum.LIT0);
>
> Instead of having to convert to a SomeEnum everywhere using:
>
> someResource.getMyProperty().add(SomeEnum.get(SomeEnum.LIT0) );
>
> :Let me know if this is not clear.
>
> The only way I have gotten this to work is to use the Teneo
> DefaultToStringUserType that I sent in my first message.
>
> Thanks for looking into this.
>
> -mike
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:f03957$s7a$1@build.eclipse.org...
>> Hi Mike,
>> Yes seen it.
>>
>> I am not sure what you with mean with enum annotation? Do you mean the
>> typedef?
>>
>> Teneo also supports enums with dynamic EMF. Here is an example of the
>> mapping of a single property if there is no instanceclass:
>> <property name="departmentType" lazy="false" not-null="false"
>> insert="true" update="true" unique="false">
>> <column not-null="false" unique="false" name="`departmenttype`"/>
>> <type name="org.eclipse.emf.teneo.hibernate.mapping.DynamicENumUserType ">
>> <param name="eclassifier">DepartmentType</param>
>> <param name="epackage">http:///www.elver.org/DynamicTest</param>
>> </type>
>> </property>
>>
>> Your point regarding osgi is interesting.
>> I would think that the issue you mention is larger than just the enum
>> class as the classloaderresolver is also used in other locations.
>> I have very little experience yet with running in osgi environments (and
>> little time on the short term to gain experience). So if you have any
>> contributions which would solve this issue (for you) then I am happy to
>> look at them and incorporate them.
>>
>> gr. Martin
>>
>> Michael Kanaley wrote:
>>> Hi Martin,
>>> Filed bugzilla number: 182815
>>> First question, what exactly should the correct ENum annotation look
>>> like?
>>> Another general problem with your ENum UserTypes is that they use an
>>> enumClass reference.
>>> Like you have said before, this does not support dynamic EMF.
>>>
>>> Also, there is a problem when trying to run Teneo in an OSGi environment.
>>> When Teneo attempts to load this class, the ClassLoaderResolver has to be
>>> set correctly - which is near impossible in OSGi which means that Teneo
>>> has to declare DynamicImport-Package: * to load the ENum attributes.
>>>
>>> This is not ideal since it binds the class instance to the Teneo plugin
>>> so different versions of the same EMF model cannot be used in the same
>>> OSGi runtime.
>>> Thanks,
>>> -mike
>>>
>>> "Martin Taal" <mtaal@elver.org> wrote in message
>>> news:f02ouh$vvd$1@build.eclipse.org...
>>>> Hi Mike,
>>>> I ran your testcase (thanks) and it fails with me also. With the 0.8.0
>>>> release this seems to work but Hibernate serializes the enumerates which
>>>> is not the best solution (not queryable, etc.).
>>>>
>>>> Teneo will add a typedef for an EDataType automatically but not for
>>>> enums, also the instanceclass of the edatatype is used in these
>>>> auto-created typedefs.
>>>> This auto-typedef creation should then also be done for enums (with a
>>>> different usertype than the edatatype instanceclass).
>>>> Can you enter a bugzilla for this? Then I'll add this.
>>>>
>>>> Btw, for enumerates the typedef will be different than you propose as
>>>> Teneo has a number of default usertypes for enumerates.
>>>>
>>>> gr. Martin
>>>>
>>>> Michael Kanaley wrote:
>>>>> Hello Martin,
>>>>> I have attached a bundle that you can directly import into Eclipse.
>>>>> I have removed hibernate and other third party JARs to keep the
>>>>> attachment
>>>>> small so it will not run until you put all the jars in the lib
>>>>> directory.
>>>>> It uses HSQLDB and the latest 0.7.5 Teneo.
>>>>> I can send you the jars if necessary.
>>>>> It will add a launcher called test.teneo.multidatatype.
>>>>>
>>>>> This model plugin has one class called SomeClass that has a single
>>>>> EAttribute called "myProperty" of type SomeEnum that has
>>>>> upperbound of -1. Teneo is creating a mapping for this attribute of the
>>>>> form:
>>>>> <list name="myProperty" lazy="true" cascade="all,delete-orphan">
>>>>>
>>>>> <key update="true">
>>>>>
>>>>> <column name="`someclass_myproperty_e_id`" not-null="true"
>>>>> unique="false"/>
>>>>>
>>>>> </key>
>>>>>
>>>>> <list-index column="`someclass_myproperty_idx`"/>
>>>>>
>>>>> <element type="test.teneo.multidatatype.SomeEnum"/>
>>>>>
>>>>> </list>
>>>>>
>>>>> When I try to persist an instance of this model, the exception at the
>>>>> end of this message is
>>>>> thrown. Unfortunately, the type should be refering to a typedef instead
>>>>> of the custom EDataType class.
>>>>> The list mapping should have had an element of the form:
>>>>> <element type="multidatatype.SomeEnum"/>
>>>>>
>>>>> The typedef multidatatype.SomeEnum should have been declared like:
>>>>> <typedef name="multidatatype.SomeEnum"
>>>>> class=" org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype ">
>>>>>
>>>>> <param
>>>>> name="epackage">http://xsd.example.org/test/multidatatype</param>
>>>>>
>>>>> <param name="edatatype">SomeEnum</param>
>>>>>
>>>>> </typedef>
>>>>>
>>>>>
>>>>> Fortunately, there is a simple workaround by declaring an annotation on
>>>>> the SomeEnum EDataType of the form:
>>>>> @TypeDef(
>>>>> name="multidatatype.SomeEnum",
>>>>> typeClass =
>>>>> org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserT ype,
>>>>> parameters = {
>>>>> @Parameter(name="epackage",
>>>>> value="http://xsd.example.org/test/multidatatype")
>>>>> @Parameter(name="edatatype", value="SomeEnum")
>>>>> }
>>>>> )
>>>>>
>>>>> Please let me know if this is considered a bug and I will file a
>>>>> bugzilla.
>>>>> Thanks,
>>>>> -mike
>>>>>
>>>>> org.hibernate.MappingException: Could not determine type for:
>>>>> test.teneo.multidatatype.SomeEnum, for columns:
>>>>> [org.hibernate.mapping.Column(elt)]
>>>>>
>>>>> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>>>>>
>>>>> at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:138)
>>>>>
>>>>> at org.hibernate.mapping.Column.getSqlType(Column.java:182)
>>>>>
>>>>> at org.hibernate.mapping.Table.sqlCreateString(Table.java:383)
>>>>>
>>>>> at
>>>>> org.hibernate.cfg.Configuration.generateSchemaUpdateScript(C onfiguration.java:884)
>>>>>
>>>>> at
>>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:140)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:478)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:180)
>>>>>
>>>>> at test.teneo.MapTests.createHbDataStore(MapTests.java:72)
>>>>>
>>>>> at test.teneo.MapTests.testSaving(MapTests.java:86)
>>>>>
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>>
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>>
>>>>> at java.lang.reflect.Method.invoke(Unknown Source)
>>>>>
>>>>> at junit.framework.TestCase.runTest(TestCase.java:154)
>>>>>
>>>>> at junit.framework.TestCase.runBare(TestCase.java:127)
>>>>>
>>>>> at junit.framework.TestResult$1.protect(TestResult.java:106)
>>>>>
>>>>> at junit.framework.TestResult.runProtected(TestResult.java:124)
>>>>>
>>>>> at junit.framework.TestResult.run(TestResult.java:109)
>>>>>
>>>>> at junit.framework.TestCase.run(TestCase.java:118)
>>>>>
>>>>> at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>>>
>>>>> at junit.framework.TestSuite.run(TestSuite.java:203)
>>>>>
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:128)
>>>>>
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>>>>>
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>>>>>
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>>>>>
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>>>>>
>>>>> at
>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>>>>>
>>>>>
>>>> --
>>>>
>>>> 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
>>>
>>
>> --
>>
>> 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
>
>


--

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:Serialize EMF Model using namespace prefix
Next Topic:[Teneo] Setting an object as 'new' in Teneo/Hibernate
Goto Forum:
  


Current Time: Tue Apr 16 15:56:21 GMT 2024

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

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

Back to the top