From: <leg...@at...> - 2003-08-12 18:55:46
|
The following comment has been added to this issue: Author: abe zafar Created: Tue, 12 Aug 2003 1:47 PM Body: I took the latest code from cvs last night and tried the following: <many-to-one name="state" class="com.rhi.domain.StateImpl" column="state_id"> <meta attribute="property-type">com.rhi.domain.State</meta> </many-to-one> My expectation was that I would get a setter and a getter method for "com.rhi.domain.State", but I still get the setter and getter for "com.rhi.domain.StateImpl". I will attach the source if I can that I got from cvs just in case this is not the latest. If you have the latest source or binary that has the changes can you please attach it to this issue so I can get it right away. --------------------------------------------------------------------- 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 |