File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 3775

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic bean creation in Spring
 
Similar Threads
Accessing Variables In a Class
Best Practices for JSF-Spring-Hibernate
Issue in submitting the Form with Arraylist in Struts 1.1
struts beginner. Pls answer this.
How to handle huge number of fields in Data Beans?