-->
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.  [ 6 posts ] 
Author Message
 Post subject: 4.2.7SP1: HibernateException: Unable to resolve property: nu
PostPosted: Tue Nov 12, 2013 6:33 am 
Newbie

Joined: Thu Sep 15, 2005 10:04 am
Posts: 14
Hi,
I am responsible for the Eclipse EMF Teneo project, I run Hibernate with a testsuite of 500+ testcases. I am upgrading to Hibernate 4.2.7SP1. I noticed that for some of my testcases I get the exception below.

This seems to happen when I have a many-to-many mapping with unique="true", with unique="false" it does not happen. (see mapping below in the post)
The many-to-many with unique=true approach is outlined here in the docs:
http://docs.jboss.org/hibernate/orm/4.2/manual/en-US/html_single/#assoc-unidirectional-join-12m

When looking at the stacktrace I get to this call in the Cascade class line 429:
cascadeProperty(
parent,
iter.next(),
elemType,
style,
null,
anything,
isCascadeDeleteEnabled
);
As you can see a null is passed for the propertyName parameter. This seems to result in the exception below.

Not sure if this is a known issue or if I should change my mapping (mapping shown below).

Code:
org.hibernate.HibernateException: Unable to resolve property: null
   at org.hibernate.tuple.entity.EntityMetamodel.getPropertyIndex(EntityMetamodel.java:791)
   at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyIndex(AbstractEntityPersister.java:2397)
   at org.hibernate.engine.spi.EntityEntry.getLoadedValue(EntityEntry.java:280)
   at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:235)
   at org.hibernate.engine.internal.Cascade.cascadeCollectionElements(Cascade.java:429)
   at org.hibernate.engine.internal.Cascade.cascadeCollection(Cascade.java:369)
   at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:345)
   at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:208)
   at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:165)


Code:
      <list name="address" table="`ABC`" lazy="true" cascade="all,delete-orphan">
         <key foreign-key="EMPLOYEE_ADDRESS_KEY" update="true">
            <column name="`EMPLOYEE_ADDR_ID`" unique="false"/>
         </key>
         <list-index column="`PERSON_ADDRESS_IDX`"/>
         <many-to-many entity-name="Address" unique="true" foreign-key="EMPLOYEE_ADDRESS"/>
      </list>


Top
 Profile  
 
 Post subject: Re: 4.2.7SP1: HibernateException: Unable to resolve property: nu
PostPosted: Mon Nov 25, 2013 4:03 pm 
Newbie

Joined: Mon Nov 25, 2013 3:59 pm
Posts: 3
Hi mtaal,

I am getting the same error starting in Hibernate 4.2.7.

Did you ever find a work-around or create a JIRA issue?

Thanks,

Darren Evenson


Top
 Profile  
 
 Post subject: Re: 4.2.7SP1: HibernateException: Unable to resolve property: nu
PostPosted: Tue Nov 26, 2013 4:28 am 
Newbie

Joined: Thu Sep 15, 2005 10:04 am
Posts: 14
Hi Darren,
No reply and did not create a JIRA issue. I do not know the standard behavior/approach for hibernate, normally what I am used to is that a JIRA is created after acknowledgement of an issue on a forum.

I moved back to an older version of Hibernate (4.1 something).

gr. Martin


Top
 Profile  
 
 Post subject: Re: 4.2.7SP1: HibernateException: Unable to resolve property: nu
PostPosted: Tue Nov 26, 2013 7:28 pm 
Newbie

Joined: Mon Nov 25, 2013 3:59 pm
Posts: 3
Hi,

I created a test case based on my mapping (which uses a Map, not an indexed list, but the same error results) and created a JIRA issue:

https://hibernate.atlassian.net/browse/HHH-8749

I also linked to this forum thread and added your mapping in comment.


Top
 Profile  
 
 Post subject: Re: 4.2.7SP1: HibernateException: Unable to resolve property: nu
PostPosted: Tue Nov 26, 2013 7:39 pm 
Newbie

Joined: Thu Sep 15, 2005 10:04 am
Posts: 14
Ok great!

gr. Martin


Top
 Profile  
 
 Post subject: Re: 4.2.7SP1: HibernateException: Unable to resolve property: nu
PostPosted: Mon Dec 02, 2013 12:13 pm 
Newbie

Joined: Mon Nov 25, 2013 3:59 pm
Posts: 3
Hi gr. Martin,

Good News. Bret at Hibernate has already made a fix for this issue. You can test the latest snapshot of 4.2.8 to make sure the fix works in your case. It worked for my case.

- Darren


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.