From: <leg...@at...> - 2003-09-05 09:34:31
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-312 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-312 Summary: Subclasses using super method not found properly Type: Bug Status: Unassigned Priority: Critical Project: Hibernate2 Components: core Versions: 2.0.3 Assignee: Reporter: Jonas Van Poucke Created: Fri, 5 Sep 2003 4:33 AM Updated: Fri, 5 Sep 2003 4:33 AM Description: Whe have two classes: --- Base Class --- public class SuperWithMap { private Map members; public void setMembers(Map value) { this.members = value; } public Map getMembers() { return members; } public void addMember(Object member) { members.put(member, null); // value is a dummy } } --- SubClass --- public class SubWithSet extends SuperWithMap { public void setMembers(Set value) { Iterator iter = value.iterator(); while (iter.hasNext()) { super.addMember(iter.next()); } } } --- Mapping --- The subclass should use the super-classes method to set the Map: <class name="SuperWithMap" table="SuperTable"> <joined-subclass name="SubWithSet" table="SubTable"> <key column="ref_id"/> <map name="members" table="RefTable" lazy="false" cascade="all"> <key column="mem_id"/> <index-many-to-many column="value_id" class="some-other-class" /> <element column="otherclassvalue" type="double"/> </map> </class> Note: the reference in the map to some-other-table is ommited --- Problem --- When trying to load data for the subclass SubWithSet, the attribute "members" is set with the method setMembers(Set value) and not with the super-classes setMembers(Map value). --------------------------------------------------------------------- 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 |