Results 1 to 1 of 1

Thread: Specifying Collection type in Annotation based declaration

  1. #1
    Join Date
    Feb 2013
    Posts
    1

    Question Specifying Collection type in Annotation based declaration

    Hello All,

    We can declare specific collection type in xml based configuration in Spring. Following is the example for it -

    <bean id="myBean" class="com.Customer">
    <property name="sets">
    <util:set set-class="java.util.HashSet">
    <value>1</value>
    <value>2</value>
    <value>3</value>
    </util:set>
    </property>
    </bean>

    OR

    <bean id="CustomerBean" class="com.mkyong.common.Customer">
    <property name="sets">
    <bean class="org.springframework.beans.factory.config.Se tFactoryBean">
    <property name="targetSetClass">
    <value>java.util.HashSet</value>
    </property>

    <property name="sourceSet">
    <list>
    <value>1</value>
    <value>2</value>
    <value>3</value>
    </list>
    </property>
    </bean>
    </property>
    </bean>

    My question is - how to achieve same with annotation based approach? What is annotation to specify exact collection type. Please help.
    Last edited by khot_arun; Feb 12th, 2013 at 08:16 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •