[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

<<attachment: winmail.dat>>

Reply via email to