spring学习之DI(依赖注入)注入复杂的类型

private String name;
    private List<String> list;
    private Map<String,String> map;

    public void setName(String name) {
        this.name = name;
    }

    public void setList(List<String> list) {
        this.list = list;
    }

    public void setMap(Map<String, String> map) {
        this.map = map;
    }
<bean id="userMapper" class="top.chenyp.mapper.impl.UserMapperImpl2">
        <property name="name" value="test"/>
        <property name="list">
            <array>
                <value>111</value>
                <value>222</value>
                <value>333</value>
            </array>
        </property>

        <property name="map">
            <map>
                <entry value="t1" key="test1"/>
                <entry value="t2" key="test2"/>
                <entry value="t3" key="test3"/>
            </map>
        </property>

    </bean>
上一篇:第八篇:node简单使用 nodemailer+node-schedule 实现定时发送邮件


下一篇:759. Employee Free Time