[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4064) Foreign key referencing nonprimary key issue with composites

Kaizer (JIRA) noreply at atlassian.com
Thu Jul 30 04:38:18 EDT 2009


Foreign key referencing nonprimary key issue with composites
------------------------------------------------------------

                 Key: HHH-4064
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4064
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.3.1
            Reporter: Kaizer


The following exception is encountered on trying to map a unidirectional one-to-many mapping with a foreign key referencing a non-primary key. 

Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:145)

I was able to proceed by removing the not-null="true" attribute from the <key> element.


Forum discussion - https://forum.hibernate.org/viewtopic.php?f=1&t=983396 

-- 
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