This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes Dynamic bean creation in Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Dynamic bean creation in Spring" Watch "Dynamic bean creation in Spring" New topic
Author

Dynamic bean creation in Spring

saakshi jain
Greenhorn

Joined: Sep 26, 2011
Posts: 10
Hi ,

Is there a way in spring wherein we can read the fields of a bean from the DB table and create a complete bean class - with getters and setters on server startup???

I require this to make my application completely configurable...as in if I have to add a new field in future , all I would require would be adding a field in the db and the bean setters and getters would be available to me.

Thanks
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3816

Better sit in the Spring forum. Moving...


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

Nothing in Spring that I know off provides this functionality off the shelf.
Creating a class dynamically at run time ... I pretty sure that's been tried a few times. Reflection could work - but it won't be pretty

google - creating a class dynamically in java

and this post on the Ranch - http://www.coderanch.com/t/385084/java/java/creating-simple-java-objects-dynamically


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
 
Don't get me started about those stupid light bulbs.
 
subject: Dynamic bean creation in Spring
 
Similar Threads
Accessing Variables In a Class
How to handle huge number of fields in Data Beans?
Best Practices for JSF-Spring-Hibernate
struts beginner. Pls answer this.
Issue in submitting the Form with Arraylist in Struts 1.1