|
From: <leg...@at...> - 2003-08-10 14:02:14
|
The following issue has been updated:
Updater: Gavin King (mailto:ga...@in...)
Date: Sun, 10 Aug 2003 9:01 AM
Comment:
This is not a bug, it is a missing (?) feature from the hbm2java tool.
It would be implemented as a <meta name="property-type">com.hp.Printer</meta>
Changes:
type changed from Bug
---------------------------------------------------------------------
For a full history of the issue, see:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-243&page=history
---------------------------------------------------------------------
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: Unassigned
Priority: Major
Project: Hibernate2
Components:
toolset
Versions:
2.0 final
Assignee:
Reporter: abe zafar
Created: Sun, 10 Aug 2003 2:54 AM
Updated: Sun, 10 Aug 2003 9:01 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
|