|
From: <leg...@at...> - 2003-08-05 11:52:15
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-231 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-231 Summary: Problem with multiple classes mapped to the same table Type: Bug Status: Unassigned Priority: Critical Project: Hibernate2 Components: core Versions: 2.0.2 Assignee: Reporter: Aksel Hilde Created: Tue, 5 Aug 2003 6:50 AM Updated: Tue, 5 Aug 2003 6:50 AM Environment: Windows 2000, jdk 1.4 Description: Hibernate seems to support mapping of multiple classes to the same table. But I've ran into trouble when trying to use this feature. The issue seem to be that the identifier space used when sorting out object in the session cache is the table name and not the class name. Example: I have class A and B, both mapped to table X. When I try to do the following: A a = session.load(A.class, new Integer(1)); .. B b = session.load(B.class, new Integer(1)); The last line fails, as the object returned is the object reference by a (gotten from the session cache). The problem as I see it is located in net.sf.hibernate.engine.Key.equals(). This metod checks on an identifier space that is the table name. Proposal for fix: - Either the class name should be the identifier space or one should be able to specify a class-level "identifier-space" attribute in the mapping file. --------------------------------------------------------------------- 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 |