Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [TENEO] Exception in HibernateDatastore
[TENEO] Exception in HibernateDatastore [message #1111646] Wed, 18 September 2013 14:20 Go to next message
Murthy Bhat is currently offline Murthy BhatFriend
Messages: 159
Registered: July 2009
Senior Member
I am trying to serialize a simple emf model to database using teneo-hibernate(in Virgo). However, when I am trying to initialize the datastore, I get the below error.

org.hibernate.MappingException: Could not determine type for: org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerUserType, for columns: [org.hibernate.mapping.Column(econtainer_class), org.hibernate.mapping.Column(e_container)]
	org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:304



Looking at many posts, I did try adding Eclipse-BuddyPolicy: dependent (also tried Bundle-BuddyPolicy: dependent) but no success. I added it in the dataaccess bundle and model bundle. My HBdatastore has following properties


Properties props = new Properties();
            props.setProperty(Environment.DRIVER, DatastoreConstants.DRIVER);
            props.setProperty(Environment.URL, DatastoreConstants.URL);
            props.setProperty(Environment.USER, DatastoreConstants.USER);
            props.setProperty(Environment.PASS, DatastoreConstants.PASS);
            props.setProperty(Environment.DIALECT,MySQL5Dialect.class.getName());
            props.setProperty(Environment.SHOW_SQL, DatastoreConstants.SHOW_SQL);
            props.setProperty(Environment.HBM2DDL_AUTO, DatastoreConstants.HBM2DDL_AUTO);
           
            
            props.setProperty(PersistenceOptions.FETCH_CONTAINMENT_EAGERLY, "true");
            props.setProperty(PersistenceOptions.FETCH_ASSOCIATION_EXTRA_LAZY, "false");
            props.setProperty(PersistenceOptions.SET_DEFAULT_CASCADE_ON_NON_CONTAINMENT,"true");
            props.setProperty(PersistenceOptions.CASCADE_POLICY_ON_NON_CONTAINMENT, "REFRESH,PERSIST,MERGE");
            props.setProperty(PersistenceOptions.INHERITANCE_MAPPING,"JOINED");



Am I missing any configuration ?
Re: [TENEO] Exception in HibernateDatastore [message #1111655 is a reply to message #1111646] Wed, 18 September 2013 14:38 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hey Murthy,
Could be indeed some plugin dependency thing. Which hibernate plugin are you using?

gr. Martin

On 09/18/2013 04:21 PM, Murthy Bhat wrote:
> I am trying to serialize a simple emf model to database using teneo-hibernate(in Virgo). However, when I am trying to
> initialize the datastore, I get the below error.
>
> org.hibernate.MappingException: Could not determine type for:
> org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerUserType, for columns:
> [org.hibernate.mapping.Column(econtainer_class), org.hibernate.mapping.Column(e_container)]
> org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:304
>
>
>
> Looking at many posts, I did try adding Eclipse-BuddyPolicy: dependent (also tried Bundle-BuddyPolicy: dependent) but no
> success. I added it in the dataaccess bundle and model bundle. My HBdatastore has following properties
>
>
> Properties props = new Properties();
> props.setProperty(Environment.DRIVER, DatastoreConstants.DRIVER);
> props.setProperty(Environment.URL, DatastoreConstants.URL);
> props.setProperty(Environment.USER, DatastoreConstants.USER);
> props.setProperty(Environment.PASS, DatastoreConstants.PASS);
> props.setProperty(Environment.DIALECT,MySQL5Dialect.class.getName());
> props.setProperty(Environment.SHOW_SQL, DatastoreConstants.SHOW_SQL);
> props.setProperty(Environment.HBM2DDL_AUTO, DatastoreConstants.HBM2DDL_AUTO);
> props.setProperty(PersistenceOptions.FETCH_CONTAINMENT_EAGERLY, "true");
> props.setProperty(PersistenceOptions.FETCH_ASSOCIATION_EXTRA_LAZY, "false");
> props.setProperty(PersistenceOptions.SET_DEFAULT_CASCADE_ON_NON_CONTAINMENT,"true");
> props.setProperty(PersistenceOptions.CASCADE_POLICY_ON_NON_CONTAINMENT, "REFRESH,PERSIST,MERGE");
> props.setProperty(PersistenceOptions.INHERITANCE_MAPPING,"JOINED");
>
>
>
> Am I missing any configuration ?
>


--

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: [TENEO] Exception in HibernateDatastore [message #1111662 is a reply to message #1111655] Wed, 18 September 2013 14:47 Go to previous messageGo to next message
Murthy Bhat is currently offline Murthy BhatFriend
Messages: 159
Registered: July 2009
Senior Member
Hello Martin,

I am using hibernate 4.1.0
My manifest is something like below

Import-Package:
org.eclipse.emf.common.notify,
org.eclipse.emf.common.util,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore.resource,
org.eclipse.emf.ecore.resource.impl,
org.eclipse.emf.ecore.xmi.impl,
org.eclipse.emf.teneo;version="2.0.1",
org.eclipse.emf.teneo.extension;version="2.0.1",
org.eclipse.emf.teneo.hibernate;version="2.0.1",
org.eclipse.emf.teneo.mapping.strategy;version="2.0.1",
org.eclipse.emf.teneo.mapping.strategy.impl;version="2.0.1",
org.hibernate;version="4.1.0.Final",
org.hibernate.cfg;version="4.1.0.Final",
org.hibernate.dialect;version="4.1.0.Final"
Require-Bundle: powermock-mockito-junit-1.5;bundle-version="1.0.0";resolution:=optional,
org.eclipse.emf.teneo;bundle-version="2.0.1",
org.eclipse.emf.ecore;bundle-version="2.9.0"
Bundle-BuddyPolicy: dependent

Thanks,
Murthy
Re: [TENEO] Exception in HibernateDatastore [message #1111664 is a reply to message #1111662] Wed, 18 September 2013 14:49 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Murthy,
Yes but which plugin provides hibernate? Is that the one made available through the elver.org update site? (that one I
manage, so it should work)

gr. Martin

On 09/18/2013 04:47 PM, Murthy Bhat wrote:
> Hello Martin,
> I am using hibernate 4.1.0
> My manifest is something like below
>
> Import-Package: org.eclipse.emf.common.notify,
> org.eclipse.emf.common.util,
> org.eclipse.emf.ecore,
> org.eclipse.emf.ecore.resource,
> org.eclipse.emf.ecore.resource.impl,
> org.eclipse.emf.ecore.xmi.impl,
> org.eclipse.emf.teneo;version="2.0.1",
> org.eclipse.emf.teneo.extension;version="2.0.1",
> org.eclipse.emf.teneo.hibernate;version="2.0.1",
> org.eclipse.emf.teneo.mapping.strategy;version="2.0.1",
> org.eclipse.emf.teneo.mapping.strategy.impl;version="2.0.1",
> org.hibernate;version="4.1.0.Final",
> org.hibernate.cfg;version="4.1.0.Final",
> org.hibernate.dialect;version="4.1.0.Final"
> Require-Bundle: powermock-mockito-junit-1.5;bundle-version="1.0.0";resolution:=optional,
> org.eclipse.emf.teneo;bundle-version="2.0.1",
> org.eclipse.emf.ecore;bundle-version="2.9.0"
> Bundle-BuddyPolicy: dependent
>
> Thanks,
> Murthy


--

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: [TENEO] Exception in HibernateDatastore [message #1111667 is a reply to message #1111664] Wed, 18 September 2013 14:55 Go to previous messageGo to next message
Murthy Bhat is currently offline Murthy BhatFriend
Messages: 159
Registered: July 2009
Senior Member
Thanks Martin.

We are using the one from 'springsource' called "com.springsource.org.hibernate.core-4.1.0.Final". Do you think this could be an issue.
Meanwhile I am trying to use the jar from elver now.

Thanks,
Murthy
Re: [TENEO] Exception in HibernateDatastore [message #1111673 is a reply to message #1111667] Wed, 18 September 2013 15:04 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Yes probably that's the issue, as the hibernate plugin needs to have the buddy-policy setup, the one on elver.org has,
the one on springsource hasn't I guess.

gr. Martin

On 09/18/2013 04:55 PM, Murthy Bhat wrote:
> Thanks Martin.
>
> We are using the one from 'springsource' called "com.springsource.org.hibernate.core-4.1.0.Final". Do you think this
> could be an issue.
> Meanwhile I am trying to use the jar from elver now.
> Thanks,
> Murthy


--

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: [TENEO] Exception in HibernateDatastore [message #1112209 is a reply to message #1111673] Thu, 19 September 2013 08:53 Go to previous message
Murthy Bhat is currently offline Murthy BhatFriend
Messages: 159
Registered: July 2009
Senior Member
Works like a charm Smile Thanks a ton Martin !
Previous Topic:How to find my Classes in the diagram editor
Next Topic:[Texo] Working with Text entities
Goto Forum:
  


Current Time: Sat Apr 20 00:53:51 GMT 2024

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

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

Back to the top