Put the @hibernate.class at the top of the superclass, then do not put any
hibernate.{class, subclass} tag at the top of the subclass. I'm doing this
in http://www.dentaku.org. It works fine like this to have your
@hibernate.id in either the subclass or the superclass.
-b
> -----Original Message-----
> From: Thompson Marzag�o [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 12, 2004 4:23 PM
> To: [EMAIL PROTECTED]
> Subject: [Xdoclet-user] hibernatedoclet: inheritance and id sequences
>
>
> Hello!
>
> I've got a hibernatedoclet problem:
>
> Let's say I have class Widget:
>
> public class Widget
> {
> private Long id;
>
> /*
> * @hibernate.id
> * column="id"
> * type="java.lang.Long"
> * generator-class="sequence"
> *
> * @hibernate.generator-param
> * name="sequence"
> * value="widget_id_seq"
> */
> public Long getId()
> {
> return id;
> }
> ...
> }
>
> public class ProjectWidget extends Widget
> {
> private Project project;
>
> ...
> }
>
> My problem is :
> How can I customize in my class ProjectWidget so that the id
> sequence is
> "project_widget_id_seq" ?
>
> If I don't do anything special with the ProjectWidget class,
> the result in
> ProjectWidget.hbm.xml is:
>
> <generator class="sequence">
> <param name="sequence">widget_id_seq</param>
> </generator>
>
> I tried adding a getId() method to the ProjectWidget class
> and specifying
> the sequence name but the result in ProjectWidget.hbm.xml is:
>
> <generator class="sequence">
> <param name="sequence">widget_id_seq</param>
> <param name="sequence">project_widget_id_seq</param>
> </generator>
>
> and what I REALLY want is:
>
> <generator class="sequence">
> <param name="sequence">project_widget_id_seq</param>
> </generator>
>
> Any way to make this work?
>
> Thanks,
> Thompson Marzagao
>
>
>
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
> _______________________________________________
> xdoclet-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
>
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user