[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-442?page=co...
]
Diego Pires Plentz commented on HHH-442:
----------------------------------------
Ramnivas Laddad, open another issue(and attach a running test case), cause I think that
you problem is another. Btw, "Person implements Entity", don't
"extends" ;-)
hibernate does not handle correctly covariant return types of java
1.5.
-----------------------------------------------------------------------
Key: HHH-442
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-442
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.0.2
Environment: INFO: Hibernate 3.0.2
Windows XP Pro
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode, sharing)
Reporter: Stefan Bühlmann
Priority: Minor
Attachments: covariant_problem.zip
Hi Gavin,
It seems as if hibernate does not handle correctly covariant return types of java 1.5.
In the example included LocalWorkspace implements LocalWorkspaceI.
The attribute visibleCommittedTrx and it's setters and getters use the type
Transaction;
But the interface LocalWorkspaceI uses TransactionI as a return type for
getVisibleCommittedTrx().
To put it the other way around, LocalWorkspace.getVisibleCommittedTrx() returns a class
and not an interface, but this still implements the interface, since it is a covariant
return type.
It compiles nicely with java 1.5, but when run it get the following:
org.hibernate.MappingException: An association from the table LOCALWORKSPACE refers to an
unmapped class: x2.elements.interfaces.TransactionI
This clearly shows, that hibernate tries to use TransactionI. But I never made a mapping
for an interface!
To use the stripped down example, just edit go.bat and set JAVA_HOME to your liking. Then
run go.bat.
But how can I upload a zip?
Bye Stefan
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira