OK, I've found a workaround to my problem, namely putting the JavaDoc on the
getter "public Set getPeople()" instead of on the field "private Set
people".

But this seems a bit lame to me. According to
http://xdoclet.codehaus.org/HibernateTags, you can put the "@hibernate.set"
tag on a field, but not the "@hibernate.one-to-many" tag. Given that the
former often (always?) requires the latter, shouldn't they both be allowed
on a field? Is this a bug in the handling of the "@hibernate.one-to-many"
tag?

I only mention this because I prefer to put the JavaDoc on my fields rather
than my methods.

Thanks,

Andrew

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf
Of Andrew Swan
Sent: Wednesday, 11 May 2005 11:37 AM
To: [email protected]
Subject: [xdoclet-plugins-interest] Newbie question about Hibernate
plug-in: specifying the class of a set property


Hi All,

I've just started using XDoclet2, and I have a question please. I've
searched the mailing list archives and looked in the Jelly files but not
found an answer.

My "foo.Organisation" class has a Set of "foo.Person" objects (these being
the people who belong to the organisation). I'm trying to use XDoclet2's
Hibernate plug-in to generate the following mapping file (which works fine
if I write it by hand):

<hibernate-mapping>
  <class table="organisation" name="foo.Organisation">
    <id access="field" name="id" type="java.lang.Integer">
      <generator class="native"/>
    </id>
    <set inverse="true" cascade="none" lazy="true" table="person"
name="people">
      <key column="organisation_fk"/>
      <one-to-many class="foo.Person"/>
    </set>
  </class>
</hibernate-mapping>

I have created the following JavaDoc for the "people" property of the
foo.Organisation class:

  /**
   * @hibernate.set
   *  inverse = "true"
   *  table = "person"
   *  lazy = "true"
   *  cascade = "none"
   * @hibernate.key column = "organisation_fk"
   * @hibernate.one-to-many class = "foo.Person"
   */
  private Set people; // a set of Person objects

However XDoclet2 gives me this error:

@hibernate.one-to-many class = "foo.Person" in foo.Organisation (line 96):
is not allowed on fields

So how does one specify the class of the set members?

Thanks for any help,
_________________________
Andrew Swan
Development Manager
Business Information Services
ph: +61-2-9387-2509
fax: +61-2-9369-3840
email: [EMAIL PROTECTED]
web: www.bisinfo.com.au



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
xdoclet-plugins-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
xdoclet-plugins-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest

Reply via email to