From: <leg...@at...> - 2003-07-27 08:51:14
|
The following issue has been updated: Updater: Shorn Tolley (mailto:Sho...@nr...) Date: Sun, 27 Jul 2003 3:50 AM Comment: This is a whole (Ant based) project that I use for testing these issues. It is stripped down to the bone. Remember that the model itself for this issue is not really very simple. If you want to run the project, just unzip it, make a HibernateSimpleTest_lib directory and chuck your JDBC jars in there, then edit hibernate.properties and run the Ant "run" target. Changes: Attachment changed to HibernateSimpleTest.zip --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-213&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-213 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-213 Summary: Component attributes and class hierarchy polymorphism Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Versions: 2.0.1 Assignee: Reporter: Shorn Tolley Created: Sun, 27 Jul 2003 2:18 AM Updated: Sun, 27 Jul 2003 3:50 AM Environment: Win2000, JDK 1.4.2, Hibernate 2.0.1 Description: Originally posted to the forum here: http://sourceforge.net/forum/forum.php?thread_id=907924&forum_id=128638 What we want to do is map the name attribute on each concrete sybtype of Contact to a different implementation (an individual name has two components parts [first and last name] whereas an entity name has only one). My basic problem is, Hibernate seems to understand the model when inserting (the right things get into the DB), but when I load() it brings back null in the name attribute. The odd thing is, I've added a debug statement to the setName() method and hibernate first sets the name attribute to the right thing (an IndividualName object with the right values) then (inside that same call to the load() method) sets the attribute to null, *on the same instance of ContactIndividual*. This is the model for what I'm trying to do: public abstract class Contact{ public abstract Name getName(); public abstract void setName(Name name); } public class ContactIndividual extends Contact {...} public class ContectEntity extends Contact {...} public class Name { } public class IndividualName extends Name {...} public class EntityName extends Name {...} --------------------------------------------------------------------- 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 |