This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32636
    
215

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.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: generate get set methods using eclipse
 
It's not a secret anymore!