|
|
|
[
Permlink
| « Hide
]
Jan Berkel - 02/Nov/03 07:00 PM
patch fixing the bug
Having the same problem, but all my classes are concrete, and I have a class sitting between my root and my subclass, something like this:
/** @hibernate.class ... */ class Activity { } class BodiedActivity extends Activity { } /** @hibernate.subclass ... */ class EmailActivity extends BodiedActivity { } I checked the patch - it seems pretty trivial to me. Only five changed lines. Can this be applied ? Thanks ! François Are there going to be some problematic side-effects with the patch in question or why isn't it applied? Seems to work fine on my machine...
new version of above patch which supports more complex object hierarchies
seems that hibernate support for xdoclet 1.2 is orphaned. see the following thread in the hibernate forum:
http://forum.hibernate.org/viewtopic.php?t=936977 forgot to mention that the second patch also includes a fix to
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-698 There might be less activity at the moment, but Xdoclet 1 is not orphanded.
I don't know if this patch will be applied, but someone may find it useful.
I have made an updated patch that adds an extends attribute to the @hibernate.subclass tag. This makes it possible to explicitly tell hibernate what it should consider the supertype to be. Useful when you want a class both extending one class and implementing another interface to behave as a subtype of the interface rather than the parent class. F.ex. /** * @hibernate.class table="files" * @hibernate.discriminator column="discriminator" */ public interface File {...} /** * @hibernate.subclass extends="File" */ public class FileImpl {...} /** * @hibernate.subclass extends="File" */ public interface Folder extends File {...} /** * @hibernate.subclass extends="Folder" */ public class FolderImpl extends FileImpl implements FileImpl {...} Using this patch, a query of the type "from Folder f where <some criteria>" will return all FolderImpl's that match the criteria. Without this patch, nothing will return, as the FolderImpl are considered to be a subtype of FileImpl, not Folder. |
|||||||||||||||||||||||||||||||||||||||||||||||||