Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Composite key in dynamic EMF model
[Teneo] Composite key in dynamic EMF model [message #536181] Thu, 27 May 2010 10:25 Go to next message
Aleksander Bandelj is currently offline Aleksander BandeljFriend
Messages: 98
Registered: July 2009
Member
Documentation for Teneo states that composite keys are not supported
with dynamic EMF objects. Indeed it doesn't seem to work. Is the reason
only that Hibernate requires that key objects override hashCode() and
equals() or are there deeper issues ?

-a
Re: [Teneo] Composite key in dynamic EMF model [message #536210 is a reply to message #536181] Thu, 27 May 2010 11:37 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I really have to dive deep in my memory here... What I seem to remember is that the instance creation of the composite
key instance (by Hibernate) can not be replaced/overridden. Hibernate expects a real class there and not a dynamic one.
Or something like that...

What exception/error do you get?

gr. Martin

Aleksander Bandelj wrote:
> Documentation for Teneo states that composite keys are not supported
> with dynamic EMF objects. Indeed it doesn't seem to work. Is the reason
> only that Hibernate requires that key objects override hashCode() and
> equals() or are there deeper issues ?
>
> -a


--

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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Composite key in dynamic EMF model [message #536346 is a reply to message #536210] Thu, 27 May 2010 17:29 Go to previous messageGo to next message
Aleksander Bandelj is currently offline Aleksander BandeljFriend
Messages: 98
Registered: July 2009
Member
Exception is about trying to get native identifier property getter and
not finding it in EDynamicObjectImpl, so Hibernate expects native class
there. I don't understand your remark about composite key instance
creation, composite keys can't be generated, they must be assigned
explicity.

OTOH, I'm quite sure Hibernate supports dynamic components as composite
keys. It works on Maps, maybe because they have well defined composite
hashCode() and equals(). With EMF objects, there could be problems (doc
states that overriding hashCode() and equals() is not absolute
requirement, just recommended)

-a

On 05/27/2010 01:37 PM, Martin Taal wrote:
> I really have to dive deep in my memory here... What I seem to
> remember is that the instance creation of the composite key instance
> (by Hibernate) can not be replaced/overridden. Hibernate expects a
> real class there and not a dynamic one. Or something like that...
>
> What exception/error do you get?
>
> gr. Martin
>
> Aleksander Bandelj wrote:
>> Documentation for Teneo states that composite keys are not supported
>> with dynamic EMF objects. Indeed it doesn't seem to work. Is the reason
>> only that Hibernate requires that key objects override hashCode() and
>> equals() or are there deeper issues ?
>>
>> -a
>
>
Re: [Teneo] Composite key in dynamic EMF model [message #536577 is a reply to message #536210] Fri, 28 May 2010 17:55 Go to previous message
Aleksander Bandelj is currently offline Aleksander BandeljFriend
Messages: 98
Registered: July 2009
Member
Ok, there is stack trace with dynamic claim model from teneo.sample :

org.hibernate.HibernateException: Unable to instantiate default tuplizer
[org.hibernate.tuple.component.PojoComponentTuplizer]
at
org.hibernate.tuple.component.ComponentTuplizerFactory.const ructTuplizer(ComponentTuplizerFactory.java:101)
at
org.hibernate.tuple.component.ComponentTuplizerFactory.const ructDefaultTuplizer(ComponentTuplizerFactory.java:122)
at
org.hibernate.tuple.component.ComponentEntityModeToTuplizerM apping. <init>(ComponentEntityModeToTuplizerMapping.java:75)
at
org.hibernate.tuple.component.ComponentMetamodel.<init>(ComponentMetamodel.java:73)
at org.hibernate.mapping.Component.buildType(Component.java:175 )
at org.hibernate.mapping.Component.getType(Component.java:168)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:2 76)
at org.hibernate.mapping.RootClass.validate(RootClass.java:216)
at org.hibernate.cfg.Configuration.validate(Configuration.java: 1149)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1334)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:205)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:90)
at
si.academa.teneo.js.test.TeneoJsTest.createDataStore(TeneoJs Test.java:95)
at si.academa.teneo.js.test.ClaimTest.setUp(ClaimTest.java:14)
at junit.framework.TestCase.runBare(TestCase.java:132)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38Cla ssRunner.java:83)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:49)
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:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:197)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:5 13)
at
org.hibernate.tuple.component.ComponentTuplizerFactory.const ructTuplizer(ComponentTuplizerFactory.java:98)
... 27 more
Caused by: org.hibernate.PropertyNotFoundException: Could not find a
getter for claimNumber in class
org.eclipse.emf.ecore.impl.DynamicEObjectImpl
at
org.hibernate.property.BasicPropertyAccessor.createGetter(Ba sicPropertyAccessor.java:306)
at
org.hibernate.property.BasicPropertyAccessor.getGetter(Basic PropertyAccessor.java:299)
at org.hibernate.mapping.Property.getGetter(Property.java:294)
at
org.hibernate.tuple.component.PojoComponentTuplizer.buildGet ter(PojoComponentTuplizer.java:156)
at
org.hibernate.tuple.component.AbstractComponentTuplizer.<init >(AbstractComponentTuplizer.java:66)
at
org.hibernate.tuple.component.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:61)
... 32 more



On 05/27/2010 01:37 PM, Martin Taal wrote:
> I really have to dive deep in my memory here... What I seem to
> remember is that the instance creation of the composite key instance
> (by Hibernate) can not be replaced/overridden. Hibernate expects a
> real class there and not a dynamic one. Or something like that...
>
> What exception/error do you get?
>
> gr. Martin
>
> Aleksander Bandelj wrote:
>> Documentation for Teneo states that composite keys are not supported
>> with dynamic EMF objects. Indeed it doesn't seem to work. Is the reason
>> only that Hibernate requires that key objects override hashCode() and
>> equals() or are there deeper issues ?
>>
>> -a
>
>
Previous Topic:Switch off resolve proxy generation for all types at once
Next Topic:Save model from GEF-App with EMF
Goto Forum:
  


Current Time: Fri Mar 29 00:50:33 GMT 2024

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

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

Back to the top