Results 1 to 4 of 4

Thread: Using ValueList with methods in DAO

  1. #1

    Default 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.

  2. #2
    Join Date
    Aug 2004
    Location
    Toulouse, France
    Posts
    148

    Default

    Can you detail a bit more what you're expecting to do ? I don't understand well what you want to achieve.

    Olivier

  3. #3

    Default

    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.

  4. #4
    Join Date
    Aug 2004
    Location
    Toulouse, France
    Posts
    148

    Default

    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
  •