Hmm...
well, my problem is that the DTD (hibernate 2) specifies that the "name" attribute on
the param tag
is mandatory.. in the example below the param tag syntax is correct..
<id name="myKey" column="X_PK">
<generator class="sequence">
<param name="sequence">seq</param>
</generator>
</id>
the attribute "name" is NOT generated by xdoclet when using something like:
/**
* @hibernate:id column="X_PK"
* generator-class="sequence"
* generator-class-parameter-1="seq"
*/
which is not strange at all, since there is no way to specify the value of the "name"
attribute using the @hibernate.id tag... Unless some strange syntax like:
generator-class-parameter-1="name:seq"
is supported...
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Mitchell
> Morris
> Sent: 03. March 2003 13:07
> To: [EMAIL PROTECTED]
> Subject: RE: [Xdoclet-user] hibernate and generator-class-param-1
>
>
> [snip]
> > Thanks.. Changing from from "param" to "parameter" actually
> > made a difference. A parameter tag is now generated in the
> > mapping file. But what about the name attribute of the
> > parameter tag? It's required, but how do you specify it
> > through xdoclet?
>
> I'm not sure I understand your question. The short answer to what
> I think your question is is you specify the name of the property
> by building your JavaBean to have the right property names.
>
> The JavaBean spec says to have a property named "fuffle" of type
> "T", you must add a method named "getFuffle()" that takes no
> arguments and returns an object of type "T". To wit:
> public T getFuffle();
> If your property is going to be mutable, then you must also
> provide a method named "setFuffle(T)" that takes one argument
> of type "T" and returns void. To wit:
> public void setFuffle(T newValue);
> If you do both of these things, then all the JavaBean stuff will
> recognize that your class has a property named "fuffle".
>
> The syntax for specifying a primary key property is, e.g.:
> private Long myKey;
>
> /**
> * @hibernate:id column="X_PK"
> * generator-class="seqhilo.long"
> * generator-class-parameter-1="PKGEN_SEQ"
> */
> public Long getMyKey() {
> return myKey;
> }
> public Long setMyKey(Long myKey) {
> this.myKey = myKey;
> }
> which will generate the following segment of the Hibernate mapping
> file:
> <id name="myKey" column="X_PK">
> <generator class="seqhilo.long">
> <param>seq</param>
> </generator>
> </id>
> Notice that the "name" attribute wasn't explicity stated
> anywhere. Is is,
> however, implicitly stated through the names of the public functions
> getXXX and setXXX. If you want to change the name of the bean
> property,
> then change the names of the getter and setter methods.
>
> So ... if you don't like the name of your property in the
> Hibernate file,
> then change the name of the property in your JavaBean.
>
> +Mitchell
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user