Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Teneo: Hibernate and Arrays as EDataType
Teneo: Hibernate and Arrays as EDataType [message #51104] Wed, 20 September 2006 09:40 Go to next message
Hans Mueller-Dieckert is currently offline Hans Mueller-DieckertFriend
Messages: 32
Registered: July 2009
Member
Hi,

we have an EMF-model in which we have defined an Integer-Array as EDataType:

<eClassifiers xsi:type="ecore:EDataType" name="IntegerArray"
instanceClassName="int[]"/>

So far everything worked just fine using only the EMF-Framework an
storing everything into XML-Files.

But trying to use the EMF - Hibernate integration results in the
following Exception:

org.hibernate.MappingException: Could not determine type for: int[], for
columns: [org.hibernate.mapping.Column(elt)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:2 53)
at org.hibernate.mapping.Collection.validate(Collection.java:26 2)
at org.hibernate.cfg.Configuration.validate(Configuration.java: 988)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1169)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.buildSessionFact ory(HbDataStore.java:474)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:187)
at


when calling

HbDataStore hbds = HbHelper.INSTANCE.createRegisterDataStore("test");
hbds.setEPackages(new Package[]{MyPackage.eINSTANCE});
hbds.setHibernateProperties(properties);
hbds.initialize(); // <- this throws the Exception

Is this a Bug, are we doing anything wrong, is there a possible workaround ?

greetings,
Hans
Re: Teneo: Hibernate and Arrays as EDataType [message #51243 is a reply to message #51104] Wed, 20 September 2006 15:12 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Hans,
Arrays are not yet supported (elists are). If you want you can enter a bugzilla to give an extra
hint that support for arrays (of primitive types) is important.

As a workaround you can try to manually adapt a generated hibernate.hbm.xml. The hibernate.hbm.xml
is generated with a right click on the .ecore file and then select the submenu under teneo.

gr. Martin

Hans Mueller-Dieckert wrote:
> Hi,
>
> we have an EMF-model in which we have defined an Integer-Array as
> EDataType:
>
> <eClassifiers xsi:type="ecore:EDataType" name="IntegerArray"
> instanceClassName="int[]"/>
>
> So far everything worked just fine using only the EMF-Framework an
> storing everything into XML-Files.
>
> But trying to use the EMF - Hibernate integration results in the
> following Exception:
>
> org.hibernate.MappingException: Could not determine type for: int[], for
> columns: [org.hibernate.mapping.Column(elt)]
> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
> at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:2 53)
> at org.hibernate.mapping.Collection.validate(Collection.java:26 2)
> at org.hibernate.cfg.Configuration.validate(Configuration.java: 988)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1169)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.buildSessionFact ory(HbDataStore.java:474)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:187)
>
> at
>
>
> when calling
>
> HbDataStore hbds = HbHelper.INSTANCE.createRegisterDataStore("test");
> hbds.setEPackages(new Package[]{MyPackage.eINSTANCE});
> hbds.setHibernateProperties(properties);
> hbds.initialize(); // <- this throws the Exception
>
> Is this a Bug, are we doing anything wrong, is there a possible
> workaround ?
>
> greetings,
> Hans


--

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: Hibernate and Arrays as EDataType [message #51435 is a reply to message #51243] Thu, 21 September 2006 12:24 Go to previous messageGo to next message
Hans Mueller-Dieckert is currently offline Hans Mueller-DieckertFriend
Messages: 32
Registered: July 2009
Member
Hi Martin,

thank you for your answer! I've just made a bugzilla entry.
Within this I've also described a problem with EByteArray, which is a
EMF-predefined EDataType. I think this is a related problem.

greetings,
Hans



Martin Taal schrieb:
> Hi Hans,
> Arrays are not yet supported (elists are). If you want you can enter a
> bugzilla to give an extra hint that support for arrays (of primitive
> types) is important.
>
> As a workaround you can try to manually adapt a generated
> hibernate.hbm.xml. The hibernate.hbm.xml is generated with a right click
> on the .ecore file and then select the submenu under teneo.
>
> gr. Martin
>
> Hans Mueller-Dieckert wrote:
>> Hi,
>>
>> we have an EMF-model in which we have defined an Integer-Array as
>> EDataType:
>>
>> <eClassifiers xsi:type="ecore:EDataType" name="IntegerArray"
>> instanceClassName="int[]"/>
>>
>> So far everything worked just fine using only the EMF-Framework an
>> storing everything into XML-Files.
>>
>> But trying to use the EMF - Hibernate integration results in the
>> following Exception:
>>
>> org.hibernate.MappingException: Could not determine type for: int[],
>> for columns: [org.hibernate.mapping.Column(elt)]
>> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>> at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:2 53)
>> at org.hibernate.mapping.Collection.validate(Collection.java:26 2)
>> at org.hibernate.cfg.Configuration.validate(Configuration.java: 988)
>> at
>> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1169)
>>
>> at
>> org.eclipse.emf.teneo.hibernate.HbDataStore.buildSessionFact ory(HbDataStore.java:474)
>>
>> at
>> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:187)
>>
>> at
>>
>>
>> when calling
>>
>> HbDataStore hbds = HbHelper.INSTANCE.createRegisterDataStore("test");
>> hbds.setEPackages(new Package[]{MyPackage.eINSTANCE});
>> hbds.setHibernateProperties(properties);
>> hbds.initialize(); // <- this throws the Exception
>>
>> Is this a Bug, are we doing anything wrong, is there a possible
>> workaround ?
>>
>> greetings,
>> Hans
>
>
Re: Teneo: Hibernate and Arrays as EDataType [message #52195 is a reply to message #51435] Fri, 22 September 2006 14:06 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Hans,
Support for arrays has been added in the version in cvs and will be available in the next build
(probably next week).

Other remarks:
- Only primitive type arrays are supported.
- Arrays are currently persisted in a separate table (so not serialized in one column/field).
- A byte array can be persisted as a blob using the lob annotation from jpa/ejb3.

This addition is done for both hibernate and jpox.

gr. Martin

Hans Mueller-Dieckert wrote:
> Hi Martin,
>
> thank you for your answer! I've just made a bugzilla entry.
> Within this I've also described a problem with EByteArray, which is a
> EMF-predefined EDataType. I think this is a related problem.
>
> greetings,
> Hans
>
>
>
> Martin Taal schrieb:
>> Hi Hans,
>> Arrays are not yet supported (elists are). If you want you can enter a
>> bugzilla to give an extra hint that support for arrays (of primitive
>> types) is important.
>>
>> As a workaround you can try to manually adapt a generated
>> hibernate.hbm.xml. The hibernate.hbm.xml is generated with a right
>> click on the .ecore file and then select the submenu under teneo.
>>
>> gr. Martin
>>
>> Hans Mueller-Dieckert wrote:
>>> Hi,
>>>
>>> we have an EMF-model in which we have defined an Integer-Array as
>>> EDataType:
>>>
>>> <eClassifiers xsi:type="ecore:EDataType" name="IntegerArray"
>>> instanceClassName="int[]"/>
>>>
>>> So far everything worked just fine using only the EMF-Framework an
>>> storing everything into XML-Files.
>>>
>>> But trying to use the EMF - Hibernate integration results in the
>>> following Exception:
>>>
>>> org.hibernate.MappingException: Could not determine type for: int[],
>>> for columns: [org.hibernate.mapping.Column(elt)]
>>> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>>> at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:2 53)
>>> at org.hibernate.mapping.Collection.validate(Collection.java:26 2)
>>> at org.hibernate.cfg.Configuration.validate(Configuration.java: 988)
>>> at
>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1169)
>>>
>>> at
>>> org.eclipse.emf.teneo.hibernate.HbDataStore.buildSessionFact ory(HbDataStore.java:474)
>>>
>>> at
>>> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:187)
>>>
>>> at
>>>
>>>
>>> when calling
>>>
>>> HbDataStore hbds = HbHelper.INSTANCE.createRegisterDataStore("test");
>>> hbds.setEPackages(new Package[]{MyPackage.eINSTANCE});
>>> hbds.setHibernateProperties(properties);
>>> hbds.initialize(); // <- this throws the Exception
>>>
>>> Is this a Bug, are we doing anything wrong, is there a possible
>>> workaround ?
>>>
>>> greetings,
>>> Hans
>>
>>


--

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: Hibernate and Arrays as EDataType [message #52348 is a reply to message #52195] Mon, 25 September 2006 09:47 Go to previous message
Hans Mueller-Dieckert is currently offline Hans Mueller-DieckertFriend
Messages: 32
Registered: July 2009
Member
Hi Martin,

thanks for the info. I'll give it a try in the next few days.

greetings,
Hans


Martin Taal schrieb:
> Hi Hans,
> Support for arrays has been added in the version in cvs and will be
> available in the next build (probably next week).
>
> Other remarks:
> - Only primitive type arrays are supported.
> - Arrays are currently persisted in a separate table (so not serialized
> in one column/field).
> - A byte array can be persisted as a blob using the lob annotation from
> jpa/ejb3.
>
> This addition is done for both hibernate and jpox.
>
> gr. Martin
>
Re: Teneo: Hibernate and Arrays as EDataType [message #591463 is a reply to message #51104] Wed, 20 September 2006 15:12 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Hans,
Arrays are not yet supported (elists are). If you want you can enter a bugzilla to give an extra
hint that support for arrays (of primitive types) is important.

As a workaround you can try to manually adapt a generated hibernate.hbm.xml. The hibernate.hbm.xml
is generated with a right click on the .ecore file and then select the submenu under teneo.

gr. Martin

Hans Mueller-Dieckert wrote:
> Hi,
>
> we have an EMF-model in which we have defined an Integer-Array as
> EDataType:
>
> <eClassifiers xsi:type="ecore:EDataType" name="IntegerArray"
> instanceClassName="int[]"/>
>
> So far everything worked just fine using only the EMF-Framework an
> storing everything into XML-Files.
>
> But trying to use the EMF - Hibernate integration results in the
> following Exception:
>
> org.hibernate.MappingException: Could not determine type for: int[], for
> columns: [org.hibernate.mapping.Column(elt)]
> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
> at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:2 53)
> at org.hibernate.mapping.Collection.validate(Collection.java:26 2)
> at org.hibernate.cfg.Configuration.validate(Configuration.java: 988)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1169)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.buildSessionFact ory(HbDataStore.java:474)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:187)
>
> at
>
>
> when calling
>
> HbDataStore hbds = HbHelper.INSTANCE.createRegisterDataStore("test");
> hbds.setEPackages(new Package[]{MyPackage.eINSTANCE});
> hbds.setHibernateProperties(properties);
> hbds.initialize(); // <- this throws the Exception
>
> Is this a Bug, are we doing anything wrong, is there a possible
> workaround ?
>
> greetings,
> Hans


--

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: Hibernate and Arrays as EDataType [message #591557 is a reply to message #51243] Thu, 21 September 2006 12:24 Go to previous message
Hans Mueller-Dieckert is currently offline Hans Mueller-DieckertFriend
Messages: 32
Registered: July 2009
Member
Hi Martin,

thank you for your answer! I've just made a bugzilla entry.
Within this I've also described a problem with EByteArray, which is a
EMF-predefined EDataType. I think this is a related problem.

greetings,
Hans



Martin Taal schrieb:
> Hi Hans,
> Arrays are not yet supported (elists are). If you want you can enter a
> bugzilla to give an extra hint that support for arrays (of primitive
> types) is important.
>
> As a workaround you can try to manually adapt a generated
> hibernate.hbm.xml. The hibernate.hbm.xml is generated with a right click
> on the .ecore file and then select the submenu under teneo.
>
> gr. Martin
>
> Hans Mueller-Dieckert wrote:
>> Hi,
>>
>> we have an EMF-model in which we have defined an Integer-Array as
>> EDataType:
>>
>> <eClassifiers xsi:type="ecore:EDataType" name="IntegerArray"
>> instanceClassName="int[]"/>
>>
>> So far everything worked just fine using only the EMF-Framework an
>> storing everything into XML-Files.
>>
>> But trying to use the EMF - Hibernate integration results in the
>> following Exception:
>>
>> org.hibernate.MappingException: Could not determine type for: int[],
>> for columns: [org.hibernate.mapping.Column(elt)]
>> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>> at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:2 53)
>> at org.hibernate.mapping.Collection.validate(Collection.java:26 2)
>> at org.hibernate.cfg.Configuration.validate(Configuration.java: 988)
>> at
>> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1169)
>>
>> at
>> org.eclipse.emf.teneo.hibernate.HbDataStore.buildSessionFact ory(HbDataStore.java:474)
>>
>> at
>> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:187)
>>
>> at
>>
>>
>> when calling
>>
>> HbDataStore hbds = HbHelper.INSTANCE.createRegisterDataStore("test");
>> hbds.setEPackages(new Package[]{MyPackage.eINSTANCE});
>> hbds.setHibernateProperties(properties);
>> hbds.initialize(); // <- this throws the Exception
>>
>> Is this a Bug, are we doing anything wrong, is there a possible
>> workaround ?
>>
>> greetings,
>> Hans
>
>
Re: Teneo: Hibernate and Arrays as EDataType [message #591793 is a reply to message #51435] Fri, 22 September 2006 14:06 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Hans,
Support for arrays has been added in the version in cvs and will be available in the next build
(probably next week).

Other remarks:
- Only primitive type arrays are supported.
- Arrays are currently persisted in a separate table (so not serialized in one column/field).
- A byte array can be persisted as a blob using the lob annotation from jpa/ejb3.

This addition is done for both hibernate and jpox.

gr. Martin

Hans Mueller-Dieckert wrote:
> Hi Martin,
>
> thank you for your answer! I've just made a bugzilla entry.
> Within this I've also described a problem with EByteArray, which is a
> EMF-predefined EDataType. I think this is a related problem.
>
> greetings,
> Hans
>
>
>
> Martin Taal schrieb:
>> Hi Hans,
>> Arrays are not yet supported (elists are). If you want you can enter a
>> bugzilla to give an extra hint that support for arrays (of primitive
>> types) is important.
>>
>> As a workaround you can try to manually adapt a generated
>> hibernate.hbm.xml. The hibernate.hbm.xml is generated with a right
>> click on the .ecore file and then select the submenu under teneo.
>>
>> gr. Martin
>>
>> Hans Mueller-Dieckert wrote:
>>> Hi,
>>>
>>> we have an EMF-model in which we have defined an Integer-Array as
>>> EDataType:
>>>
>>> <eClassifiers xsi:type="ecore:EDataType" name="IntegerArray"
>>> instanceClassName="int[]"/>
>>>
>>> So far everything worked just fine using only the EMF-Framework an
>>> storing everything into XML-Files.
>>>
>>> But trying to use the EMF - Hibernate integration results in the
>>> following Exception:
>>>
>>> org.hibernate.MappingException: Could not determine type for: int[],
>>> for columns: [org.hibernate.mapping.Column(elt)]
>>> at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:2 66)
>>> at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:2 53)
>>> at org.hibernate.mapping.Collection.validate(Collection.java:26 2)
>>> at org.hibernate.cfg.Configuration.validate(Configuration.java: 988)
>>> at
>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1169)
>>>
>>> at
>>> org.eclipse.emf.teneo.hibernate.HbDataStore.buildSessionFact ory(HbDataStore.java:474)
>>>
>>> at
>>> org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:187)
>>>
>>> at
>>>
>>>
>>> when calling
>>>
>>> HbDataStore hbds = HbHelper.INSTANCE.createRegisterDataStore("test");
>>> hbds.setEPackages(new Package[]{MyPackage.eINSTANCE});
>>> hbds.setHibernateProperties(properties);
>>> hbds.initialize(); // <- this throws the Exception
>>>
>>> Is this a Bug, are we doing anything wrong, is there a possible
>>> workaround ?
>>>
>>> greetings,
>>> Hans
>>
>>


--

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: Hibernate and Arrays as EDataType [message #591855 is a reply to message #52195] Mon, 25 September 2006 09:47 Go to previous message
Hans Mueller-Dieckert is currently offline Hans Mueller-DieckertFriend
Messages: 32
Registered: July 2009
Member
Hi Martin,

thanks for the info. I'll give it a try in the next few days.

greetings,
Hans


Martin Taal schrieb:
> Hi Hans,
> Support for arrays has been added in the version in cvs and will be
> available in the next build (probably next week).
>
> Other remarks:
> - Only primitive type arrays are supported.
> - Arrays are currently persisted in a separate table (so not serialized
> in one column/field).
> - A byte array can be persisted as a blob using the lob annotation from
> jpa/ejb3.
>
> This addition is done for both hibernate and jpox.
>
> gr. Martin
>
Previous Topic:Teneo: storing custom EDataType attributes (i.e. java.io.File)
Next Topic:JET - Feature 'version' not found
Goto Forum:
  


Current Time: Fri Apr 26 13:20:53 GMT 2024

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

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

Back to the top