-
Bug
-
Resolution: Done
-
Major
-
EAP_EWP 5.1.0
-
-
-
Documented as Resolved Issue
-
ON_QA
See http://opensource.atlassian.com/projects/hibernate/browse/HHH-6204
=====
To duplicate the issue, create three tables in a database with no declared primary or foreign keys. Map entities to two of the tables. One of these entities has a primitive @Id; the other has an @EmbeddedId. Both entities contain an additional field used to join with the third table and populate a collection.
This works with the entity that has a primitive @Id but for the entity with @EmbeddedId, trying to do anything with the collection after calling the getter results in:
javax.ejb.EJBException: org.hibernate.PropertyAccessException: could not get a field value by reflection getter of jboss.example.DoesNotWorkPk.id1
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:77)
....
Caused by: org.hibernate.PropertyAccessException: could not get a field value by reflection getter of jboss.example.DoesNotWorkPk.id1
at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:58)
....
Caused by: java.lang.IllegalArgumentException: Can not set java.lang.String field jboss.example.DoesNotWorkPk.id1 to jboss.example.DoesNotWork
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
I've attached a sample project. The relevant files are Works.java, DoesNotWork.java, and DoesNotWorkPk.java
There's also data.sql to populate a mysql db, but I think any DB will do.
=====
- is incorporated by
-
JBPAPP-10932 Upgrade Hibernate ORM for EAP 5.3
- Resolved