-
Nov 15th, 2005, 04:00 AM
#1
Using ValueList with methods in DAO
Hi,
I would like to know if there is a way to use valueList with methods defined in my DAO instead of writting sql statments in the the configuration files.
Thanks in Advance.
Sherihan.
-
Nov 15th, 2005, 05:25 AM
#2
Can you detail a bit more what you're expecting to do ? I don't understand well what you want to achieve.
Olivier
-
Nov 15th, 2005, 08:08 AM
#3
Hi,
what I mean is :
to configure valueList you need to define a bean in the applicationContex.xml as follows:
<bean id="valueListHandler" singleton="true"
class = "net.mlw.vlh.DefaultValueListHandlerImpl">
<property name="config.adapters">
<map>
<entry key="playerRank">
<bean class="net.mlw.vlh.adapters.jdbs.dynabean.DefaultD ynaBeanAdapter">
<property name="dataSource"><ref bean="dataSource"/></property>
<property name="defaultNumberPerPage"><value>20</value><property>
<property name="sql">
<value> { Query is added here} </value>
</property>
</bean>
</entry>
</map>
<property>
</bean>
I want to replace the sql property with a method in the DAO instead of pure sql.
Hope everything is clear now.
Thanks in Advance.
-
Nov 15th, 2005, 08:52 AM
#4
It's clearer for me. If you want to use the return value of a method call instead of a hardcoded string in your bean definition, I think you need the MethodInvokingFactoryBean (cf http://static.springframework.org/sp...s.html#d0e2351 for example)
hth
Olivier
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