• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Create bean with Init method

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Is there any plugin or tool for create POJO or bean with init() method ?
Not just POJO with getter, setter method. I need init method with default values.

Thanks
Kathiresan
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would the plugin know what the default values are?

Are you talking an IDE plugin, or a Spring plugin?
 
Rancher
Posts: 377
Android Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

Can't you create a default constructor that sets default values?

Sean
 
Kathiresan Chinna
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Guys,

I need to call like following in init() method

bean.setAddress1("");
bean.setAddress2("");
bean.setCity("");
bean.setState("");
bean.setZip("");

Also I have to create class which implements ParameterizedRowMapper
But I have around 50 columns to map like

car.setAddress1(rs.getString("ADDRESS1"));
car.setAddress2(rs.getString("ADDRESS2"));
car.setCity(rs.getString("CITY"));
car.setState(rs.getString("STATE"));

So am looking any external tool or eclipse plugin for generate this.

Thanks in advance
Kathiresan
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kathiresan Chinna wrote:
car.setAddress1(rs.getString("ADDRESS1"));
car.setAddress2(rs.getString("ADDRESS2"));
car.setCity(rs.getString("CITY"));
car.setState(rs.getString("STATE"));


I suggest to use a Data Mapper Framework like iBATIS.

Regarding code generation, you should try Code templates feature.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!