Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » Teneo: Hibernate and Arrays as EDataType
|
Re: Teneo: Hibernate and Arrays as EDataType [message #51243 is a reply to message #51104] |
Wed, 20 September 2006 15:12 |
Martin Taal 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 |
Hans Mueller-Dieckert 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 |
Martin Taal 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 #591463 is a reply to message #51104] |
Wed, 20 September 2006 15:12 |
Martin Taal 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 |
Hans Mueller-Dieckert 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 |
Martin Taal 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
|
|
| |
Goto Forum:
Current Time: Thu Nov 21 12:02:28 GMT 2024
Powered by FUDForum. Page generated in 0.03705 seconds
|