-
Jul 5th, 2007, 11:57 AM
#1
Accessing bean's getProperty in the config files
Hi,
I had some problems trying to set a particular property of a bean, in a config file, with static data given in another class, java.sql.Types.
From my understanding spring config supports setting of value either as a complete bean, using the ref attribute, or as a literal, using the value attribute. Would be great if someone can help.
The config file looks like this:...here i am hardcoding a value of 4 under bean spBInt. But ideally, i would like to set that to java.sql.Types.INTEGER.
<bean id="spBInt"
class="org.springframework.jdbc.core.SqlParameter" >
<constructor-arg>
<value>4</value>
</constructor-arg>
</bean>
<bean id="queryObjectPerson" class="springJdbc.QueryObject">
<constructor-arg index="0" ref="dataSource" />
<constructor-arg index="1" value="Person" />
<constructor-arg index="2">
<list>
<value>id</value>
</list>
</constructor-arg>
<constructor-arg index="3" >
<list>
<ref bean="spBInt" /
</list>
</constructor-arg>
</bean>
thanks in advance guys
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules