Message:
The following issue has been reopened.
Reopener: Max Rydahl Andersen
Date: Wed, 13 Aug 2003 2:18 AM
reopening.
Could you please send a complete hbm.xml that has the problem ?
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-243
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-243
Summary: Polymorphic associations are not handled properly
Type: Improvement
Status: Reopened
Priority: Major
Project: Hibernate2
Components:
toolset
Fix Fors:
2.1
Versions:
2.0 final
Assignee: Max Rydahl Andersen
Reporter: abe zafar
Created: Sun, 10 Aug 2003 2:54 AM
Updated: Wed, 13 Aug 2003 2:18 AM
Environment: JDK1.4
Description:
If I have an association like this one:
<many-to-one classname="com.hp.Printer"/>
and Printer does not have a mapping but it is an interface for a class called com.hp.ColorPrinter that does have a mapping, I would get two methods generated as I would expect:
public void setPrinter( Printer printer ) {
...
}
public Printer getPrinter() {
...
}
But since "com.hp.Printer" was never mapped I would get a rutime exception saying cannot find the mapping. If through some other tag or the <many-to-one> tag itself I can indicate that use the interface type for code generation but use the implementation class to look for the mapping the problem would be solved. For example if we had something like this:
<many-to-one compile-time-class="com.hp.Printer" run-time-class="com.hp.ColorPrinter"/> then the setter and getter would be generated using the compile-time-class and the run-time-class would be used to look up the mapping at runtime.
---------------------------------------------------------------------
JIRA INFORMATION:
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
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|