-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Problems with merge API
PostPosted: Mon May 21, 2007 11:12 am 
Senior
Senior

Joined: Mon Jul 24, 2006 8:43 am
Posts: 160
Hi,
I have a 1:1 relationship between person and address. Person is the owner of the rel, contains the foreign key. When I refresh the address, I get an exception, see below for further details.
Any ideas?

Hibernate version:
Annotations: 3.2.0 CR1, 13.05.2006
Core: 3.2 cr2
EntityManager: 3.2.0.CR1, 13.05.2006

Code between sessionFactory.openSession() and session.close():

EntityManager em = emf.createEntityManager();
address.setPerson(person);
person.setHomeAddress(address);
em.persist(address);
em.persist(person);
em.getTransaction().begin();
em.getTransaction().commit();

em.clear();
em.merge(address);


Full stack trace of any exception that occurs:

org.hibernate.PropertyAccessException: could not get a field value by reflection getter of com.fineos.ta3g.jpa.datatypes.EntityOid.c
at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:35)
at org.hibernate.tuple.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:58)
at org.hibernate.tuple.AbstractComponentTuplizer.getPropertyValues(AbstractComponentTuplizer.java:64)
at org.hibernate.tuple.PojoComponentTuplizer.getPropertyValues(PojoComponentTuplizer.java:76)
at org.hibernate.type.ComponentType.getPropertyValues(ComponentType.java:307)
at org.hibernate.type.ComponentType.getHashCode(ComponentType.java:158)
at org.hibernate.engine.EntityUniqueKey.generateHashCode(EntityUniqueKey.java:63)
at org.hibernate.engine.EntityUniqueKey.<init>(EntityUniqueKey.java:44)
at org.hibernate.type.EntityType.loadByUniqueKey(EntityType.java:352)
at org.hibernate.type.EntityType.resolve(EntityType.java:306)
at org.hibernate.type.EntityType.replace(EntityType.java:207)
at org.hibernate.type.TypeFactory.replace(TypeFactory.java:431)
at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:282)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:246)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:99)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:51)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:679)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:663)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:667)
at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:201)
... 18 more


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 6:36 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I think it has been solved is subsequent versions. Try the latest of Hibernate core, annotations and entitymanager

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.