[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1852) @MappedSuperclass - PropertyAccessException

Carlo Luib-Finetti (JIRA) noreply at atlassian.com
Wed Feb 27 02:39:33 EST 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29601 ] 

Carlo Luib-Finetti commented on HHH-1852:
-----------------------------------------

I had the same error while executing a HQL query which gives a scalar result (no entity). The query was successfully executed on the database, and then in the process of resolving the query results, Hibernate ran into that error.

What I can see in the debugger is that DirectPropertyAccessor$DirectGetter.get() throws an IllegalArgumentException; the causing Field is the "id" field of my base entity class (@MappedSuperClass) of the entity under inspection.

I solved this problem with a workaround: I changed the query from HQL to a native SQL query (gently using the generated SQL from Hibernate's translation of my HQL -:))

> @MappedSuperclass - PropertyAccessException
> -------------------------------------------
>
>                 Key: HHH-1852
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1852
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.0.cr2
>         Environment: hibernate-3.2.0.cr2, hibernate-annotations-3.2.0.cr1, hibernate-entitymanager-3.2.0.cr1
>            Reporter: David de Mingo
>         Attachments: src.zip
>
>
> Caused by: org.hibernate.PropertyAccessException: could not get a field value by reflection getter of org.endea.model.product.ProductAttribute.data
> 	at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:35)
> 	at org.hibernate.property.DirectPropertyAccessor$DirectGetter.getForInsert(DirectPropertyAccessor.java:40)
> 	at org.hibernate.tuple.AbstractEntityTuplizer.getPropertyValuesToInsert(AbstractEntityTuplizer.java:264)
>     ...
> Caused by: java.lang.IllegalArgumentException
> 	at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:37)
> 	at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:18)
> 	at java.lang.reflect.Field.get(Field.java:357)
> 	at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:32)
> 	... 41 morer

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list