Announcement Announcement Module
Collapse
No announcement yet.
Specifying Collection type in Annotation based declaration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 09:16 AM.
Working...
X