The following issue has been updated:
Updater: Gavin King (mailto:ga...@in...)
Date: Fri, 5 Sep 2003 6:09 AM
Comment:
This is known and is a _very_ low priority. I won't be addressing this anytime soon. You might like to have a look at creating your own patch, but if it complicates the code significantly, I probably won't accept it.
Changes:
type changed from Bug
priority changed from Critical
---------------------------------------------------------------------
For a full history of the issue, see:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-312&page=history
---------------------------------------------------------------------
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: Improvement
Status: Unassigned
Priority: Minor
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 6:09 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
|