Dynamic creation of beans in Spring

后端 未结 3 1355
面向向阳花
面向向阳花 2020-12-21 18:45

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????

3条回答
  •  既然无缘
    2020-12-21 19:28

    You could try approaches for dynamically registering beans . You could use the BeanDefinitionBuilder for this purpose . See a sample here . But as @Darren says , It's not a wise idea to creak a bean via DB lookup .

提交回复
热议问题