my dog learned polymorphism*
The moose likes IDEs, Version Control and other tools and the fly likes generate get set methods using eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "generate get set methods using eclipse" Watch "generate get set methods using eclipse" New topic
Author

generate get set methods using eclipse

Hemu Koru
Greenhorn

Joined: Dec 27, 2002
Posts: 1
Hi,

I have eclipse installed on my machine, how do i generate get, set methods automatically for a class/interface, just by giving the names of the methods, their return types, and arguments. I have about 50 fields in mysql database and I want to generate a class matching the fields of the mysql database. It takes me hours to code this class manually.

Thanks
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30369
    
150

Hemu,
Just using Eclipse, you can create a class with the fields. For example,


Then, go to the outline pane. Right click and select "generate getters and setters." Then pick select all and Eclipse will do the rest of the work.

You might also want to look into an O/R (object/relational) mapping tool.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
jQuery in Action, 2nd edition
 
subject: generate get set methods using eclipse