Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Texo: problem with GroupFeatureGroup(org.hibernate.MappingException: Could not determine type)
Texo: problem with GroupFeatureGroup [message #868781] Wed, 02 May 2012 14:31 Go to next message
Olaf Burdziakowski is currently offline Olaf BurdziakowskiFriend
Messages: 46
Registered: April 2012
Member
I generated with Texo project to connect to database with EntityManager - hibernate.

The problem is that Texo generated my list as FeatureList:

private List<ListTypeGroupFeatureGroup> group = new ArrayList<ListTypeGroupFeatureGroup>();

There are no assigned annotations and then:

EntityManagerProvider.getInstance().setPersistenceUnitName("MyManager");
EntityManagerProvider.getInstance().initialize();
cause an error:

Caused by: org.hibernate.MappingException: Could not determine type for: java.util.List, at table: ListType, for columns: [org.hibernate.mapping.Column(group)]

Where is the problem? In Texo or in my configuration?

I attach my model files and persistence to test.
  • Attachment: model.zip
    (Size: 7.28KB, Downloaded 111 times)
Re: Texo: problem with GroupFeatureGroup [message #868916 is a reply to message #868781] Wed, 02 May 2012 18:27 Go to previous messageGo to next message
Olaf Burdziakowski is currently offline Olaf BurdziakowskiFriend
Messages: 46
Registered: April 2012
Member
I will add here some more details:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http: //creconfigdir.model" targetNamespace="http: //creconfigdir.model" xmlns:xs="http: //www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="listType">
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="file">
<xs:complexType>
<xs:attribute name="valid_from" type="xs:dateTime" use="required"/>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="list" type="listType"/>
</xs:schema>

The list type is translated to code:
@Entity(name = "ListType")
public class ListType extends Identifiable {
//here I think there are missing some annotations
private List<ListTypeGroupFeatureGroup> group = new ArrayList<ListTypeGroupFeatureGroup>();
...

And later:
public class ListTypeGroupFeatureGroup {
...
@ManyToOne(cascade = { CascadeType.ALL }, optional = false, targetEntity = FileType.class)
@JoinColumns({ @JoinColumn() })
private FileType file;

I think there is something wrong with the schema...
Re: Texo: problem with GroupFeatureGroup [message #868932 is a reply to message #868781] Wed, 02 May 2012 18:49 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Olaf,
The xsd:choice results in a featureGroup. Currently featureGroups are not automatically mapped to the database. I have
not spend time there yet. It should be doable as the java code is correctly generated and only consists of pojos. But
the featuregroups need some attention. You can enter a feature request for it though... It will be a few weeks before I
have time probably (but you never know...).

gr. Martin

On 05/02/2012 04:31 PM, Olaf Burdziakowski wrote:
> I generated with Texo project to connect to database with EntityManager - hibernate.
>
> The problem is that Texo generated my list as FeatureList:
>
> private List<ListTypeGroupFeatureGroup> group = new ArrayList<ListTypeGroupFeatureGroup>();
>
> There are no assigned annotations and then:
>
> EntityManagerProvider.getInstance().setPersistenceUnitName("MyManager");
> EntityManagerProvider.getInstance().initialize();
> cause an error:
>
> Caused by: org.hibernate.MappingException: Could not determine type for: java.util.List, at table: ListType, for columns: [org.hibernate.mapping.Column(group)]
>
> Where is the problem? In Texo or in my configuration?
>
> I attach my model files and persistence to test.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: Texo: problem with GroupFeatureGroup [message #868970 is a reply to message #868932] Wed, 02 May 2012 19:43 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Saw your other post, for completeness also a repeating sequence is handled as featuregroup and needs new automatic ORM
mapping behavior...

gr. Martin


On 05/02/2012 08:49 PM, Martin Taal wrote:
> Hi Olaf,
> The xsd:choice results in a featureGroup. Currently featureGroups are not automatically mapped to the database. I have
> not spend time there yet. It should be doable as the java code is correctly generated and only consists of pojos. But
> the featuregroups need some attention. You can enter a feature request for it though... It will be a few weeks before I
> have time probably (but you never know...).
>
> gr. Martin
>
> On 05/02/2012 04:31 PM, Olaf Burdziakowski wrote:
>> I generated with Texo project to connect to database with EntityManager - hibernate.
>>
>> The problem is that Texo generated my list as FeatureList:
>>
>> private List<ListTypeGroupFeatureGroup> group = new ArrayList<ListTypeGroupFeatureGroup>();
>>
>> There are no assigned annotations and then:
>>
>> EntityManagerProvider.getInstance().setPersistenceUnitName("MyManager");
>> EntityManagerProvider.getInstance().initialize();
>> cause an error:
>>
>> Caused by: org.hibernate.MappingException: Could not determine type for: java.util.List, at table: ListType, for
>> columns: [org.hibernate.mapping.Column(group)]
>>
>> Where is the problem? In Texo or in my configuration?
>>
>> I attach my model files and persistence to test.
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: Texo: problem with GroupFeatureGroup [message #868988 is a reply to message #868970] Wed, 02 May 2012 20:21 Go to previous messageGo to next message
Olaf Burdziakowski is currently offline Olaf BurdziakowskiFriend
Messages: 46
Registered: April 2012
Member
Thank you Martin, I can generate some annotations by myself, but could you please fill my example with annotations, I will than rework other cases with same pattern.
Re: Texo: problem with GroupFeatureGroup [message #869019 is a reply to message #868988] Wed, 02 May 2012 21:23 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Olaf,
Sorry I am not able to fullfill your request.

Fyi, many people (including myself) are independent consultants. We do not receive direct payment for our support on
this forum. I am afraid that your last request does not fall within 'free' support.. I am sure you understand, ofcourse
if you are interested in direct paid support then feel free to contact me ;-).

Can you enter a feature request for automatic mapping of feature groups?

gr. Martin

On 05/02/2012 10:21 PM, Olaf Burdziakowski wrote:
> Thank you Martin, I can generate some annotations by myself, but could you please fill my example with annotations, I
> will than rework other cases with same pattern.


--

With Regards, Martin Taal

Springsite/Elver.oroupg
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: Texo: problem with GroupFeatureGroup [message #869251 is a reply to message #869019] Thu, 03 May 2012 06:02 Go to previous messageGo to next message
Olaf Burdziakowski is currently offline Olaf BurdziakowskiFriend
Messages: 46
Registered: April 2012
Member
OK Martin, I understand. Where should I enter the feature request? In bugzilla?
Re: Texo: problem with GroupFeatureGroup [message #869279 is a reply to message #869251] Thu, 03 May 2012 07:06 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Yes Olaf, that's the place!

On 05/03/2012 08:02 AM, Olaf Burdziakowski wrote:
> OK Martin, I understand. Where should I enter the feature request? In bugzilla?


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:File Not Found error on loading calling getResource
Next Topic:Collecting all objects for treeviewer
Goto Forum:
  


Current Time: Thu Sep 26 20:20:10 GMT 2024

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

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

Back to the top