|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.jdbc.core.support.JdbcBeanDefinitionReader
public class JdbcBeanDefinitionReader
ListableBeanFactory implementation that reads values from a database table. Expects columns for bean name, property name and value as string. Formats for each are identical to the properties format recognized by PropertiesBeanDefinitionReader.
PropertiesBeanDefinitionReader| Constructor Summary | |
|---|---|
JdbcBeanDefinitionReader(DefaultListableBeanFactory beanFactory)
Create a new JdbcBeanDefinitionReader for the given bean factory. |
|
| Method Summary | |
|---|---|
void |
loadBeanDefinitions(String sql)
Load bean definitions from the database via the given SQL string. |
void |
setDataSource(DataSource dataSource)
Set the DataSource to use to obtain database connections. |
void |
setJdbcTemplate(JdbcTemplate jdbcTemplate)
Set the JdbcTemplate to be used by this bean factory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JdbcBeanDefinitionReader(DefaultListableBeanFactory beanFactory)
| Method Detail |
|---|
public void setDataSource(DataSource dataSource)
public void setJdbcTemplate(JdbcTemplate jdbcTemplate)
public void loadBeanDefinitions(String sql)
sql - SQL query to use for loading bean definitions.
The first three columns must be bean name, property name and value.
Any join and any other columns are permitted: e.g.
SELECT BEAN_NAME, PROPERTY, VALUE FROM CONFIG WHERE CONFIG.APP_ID = 1
It's also possible to perform a join. Column names are not significant --
only the ordering of these first three columns.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||