|
From: <leg...@at...> - 2003-08-10 17:04:14
|
Message:
The following issue has been closed.
Resolver: Max Rydahl Andersen
Date: Sun, 10 Aug 2003 12:04 PM
I have updated hbm2java in CVS to handle this.
It now has the <meta attribute="property-type">com.hp.Printer</meta> support which can be used with <any> tags.
And it also has new support for <meta attribute="interface">true</meta> which can
be used to generated interfaces instead of concrete classes from the hbm.xml files.
Please try it out and inform me if you find any uncovered combinations I havent thought of ;)
---------------------------------------------------------------------
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: Closed
Priority: Major
Resolution: FIXED
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: Sun, 10 Aug 2003 12:04 PM
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
|