| Here is my analysis of the problem in my specific use case mentioned above. But I want to say that both Address and Country object, as well as the many-to-one property was used in Hibernate 3.x and without any issue. Below are some details about the stack trace: 1. org.hibernate.persister.entity.AbstractEntityPersister.finDirty was called and the static TypeHelper.findDirty comes to the play; 2. the map-to-one element was loaded as a NonIdentifierAttribute object: org.hibernate.type.TypeHelper.findDirty: property is {Attribute(name=countryObject, type=lookup.Country [non-identifier,association])} 3. A call of properties[i].getType() determines that is a MapToOneType, the isDirty calls to getIdentifierType(seesion) to determine the type of the identity of this associationtype, which is BigDecimal on lookup.Country 4. Since the join is not on the identity as usually do for associations the "property-ref" value is a String the cast to BigDecimal throws an Exception. Make sense? |