[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5730) Sub-classes of parent may have different id column but Hibernate does not support it!!!!!
Colbert Philippe (JIRA)
noreply at atlassian.com
Thu Nov 11 19:48:13 EST 2010
Sub-classes of parent may have different id column but Hibernate does not support it!!!!!
-----------------------------------------------------------------------------------------
Key: HHH-5730
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5730
Project: Hibernate Core
Issue Type: Improvement
Reporter: Colbert Philippe
In my current project, I am in a situation where I have two classes with a lot of common attributes. So I created a common parent-class to hold the common attributes and I created the two subclasses from the parent, each with it's own id attribute (with different column names). Herein lies the problem.
The way the inheritance strategy is implemented under Hibernate native XML meta-data, having different id columns for the subclasses is not possible. The xml schema will not allow it. I understand the reasoning behind forcing subclasses in a inheritance hierarchy to have the same id column. But obviously, there are some situations, like mine, where we want different id column for sub-classes. My complain is that Hibernate should allow subclasses of a parent-class to have different id column.
Incidentally, I also used JPA-2 under Hibernate. The specification for JPA-2 allow for what I stated above. I like the way parent and subclasses feature is implemented in JPA-2. It's simple, intuitive and modular. .
--
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list