hbm2hbmxml generates xml for subclasses that doesn't validate under the dtd

Description

When generating xml for subclasses, hbm2hbmxml makes the following errors:

1) A table attribute is always generated, but this is not a valid attribute for the subclass element

2) A discriminator-value attribute is always generated, but this is not a valid attribute for the
union-subclass element.

3) An Id element is generated, but this is not valid for any of the three different kinds of subclass
elemtns.

A test case (test.jar) is attached demonstrating a subclass element thatis generated with a table attribute
and an id element.

A suggested patch is also attached. It entails small changes to persistentclas.hbm.ftl and three
simple helper methods added to Cfg2HbmTool.java to support the persistentclass.hbm.ftl changes.

Environment

None

Attachments

2
  • 13 Sep 2006, 07:18 AM
  • 13 Sep 2006, 07:18 AM

Activity

Show:

Max Rydahl Andersen September 13, 2006 at 1:46 PM

thanks. applied with some small changes to handle joined-subclass et.al. too.
Probably still not perfect, but better than before

Good you added a testcase, but next time it would be great if you just added the corresponding
hbm.xml's since annotations is not available from hibernatetools test directly.

Fixed

Details

Assignee

Reporter

Patch Reminder (view)

Contributions and patches should be using the GitHub Fork + Pull model

Patch Reminder (edit)

Contributions and patches should be using the GitHub [Fork + Pull model|href="https://help.github.com/articles/using-pull-requests]

Participants

Bruce Cota
Max Rydahl Andersen

Components

Fix versions

Affects versions

Priority

Created September 13, 2006 at 7:18 AM
Updated September 13, 2006 at 2:06 PM
Resolved September 13, 2006 at 2:06 PM