facebook

Hibernate composite key class generation

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #213282 Reply

    Thomas Trostel
    Participant

    I was looking at the generated code for each key class and noticed in the equals method the following:

    
        /**
         * Implementation of the equals comparison on the basis of equality of the id components.
         * @param rhs
         * @return boolean
         */
        public boolean equals(Object rhs)
        {
            if (rhs != null)
                return false;
    

    Do you mean to say if (rhs == null) or (rhs != null) ??

    Fixing this bug makes everything work. My co-worker says you owe him his own honorary MyEclipse tee shirt now for finding the bug LOL!

    #213292

    Riyad Kalla
    Member

    I have sent that along, thanks ttrostel.

    #213362

    support-jeff
    Member

    D’oh! My bad. Will get this fixed immediately. In the meantime, you can change the velocity template inside the com.genuitec.eclipse.hibernate plugin, the file is templates/mappedobject.vm.

    #213363

    support-jeff
    Member

    sorry, the key class code template is templates/compositeid.vm.

    #213446

    Thomas Trostel
    Participant

    Hah … awesome. I’ll go change my template now.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Hibernate composite key class generation

You must be logged in to post in the forum log in