I made it with rabbits instead of cats...

In the Dog class:
        /**
         * @hibernate.collection-many-to-many
         *              column = "FK_RABBIT_ID"
         *              class = "kjahn.test.pets.RabbitVO"
         * @hibernate.collection-key column = "FK_DOG_ID"
         * @hibernate.set
         *              lazy = "false"
         *              table = "DOG_BARKS_RABBIT"
         *              cascade = "save-update"
         * @return Returns the rabbits.
         * Bidirectional Association: "Dog barks at Rabbits"
         */
        public Set<RabbitVO> getRabbits() {
                return rabbits;
        }
        public void setRabbits(Set<RabbitVO> rabbits) {
                this.rabbits = rabbits;
        }
        public void addRabbit(RabbitVO rabbit) {
                this.getRabbits().add(rabbit);
        }

In the Rabbit class:
        /**
         * @hibernate.collection-many-to-many
         *              column = "FK_DOG_ID"
         *              class = "kjahn.test.pets.DogVO"
         * @hibernate.set
         *              lazy = "false"
         *              table = "DOG_BARKS_RABBIT"
         *              cascade = "save-update"
         * @hibernate.collection-key column = "FK_RABBIT_ID"
         * @return Returns the dogs.
         * Bidirectional Association: "Rabbit gets barked by Dogs"
         */
        public Set<DogVO> getDogs() {
                return dogs;
        }
        public void setDogs(Set<DogVO> dogs) {
                this.dogs = dogs;
        }
        public void addDog(DogVO dog) {
                this.getDogs().add(dog);
        }

This will set up an association table "DOG_BARKS_RABBIT".
Hope this helps you.
Karsten



Eric Chow schrieb:
Yes, can you show me the example with XDoclet tag ?

Eric



On Wed, 02 Mar 2005 13:45:01 +0100, Karsten J. <[EMAIL PROTECTED]> wrote:

I like that pets thing and always talk of a dog, barking at n cats, and
a cat, being barked at by n dogs.
n dogs bark at m cats

Did you really mean something like that?!
Karsten

Eric Chow schrieb:

Is there any simple example to use Value-Object in M:N relationship ??

Eric


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ xdoclet-user mailing list xdoclet-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-user



------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ xdoclet-user mailing list xdoclet-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-user




------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ xdoclet-user mailing list xdoclet-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-user




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
xdoclet-user mailing list
xdoclet-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to