Tag:small railway station

  • Type and spring dependency injection


    Manual mode – configuration or programming to schedule injection rules in advance XML resource configuration meta information Java annotation configuration meta information API configuration meta information Automatic mode – the implementer provides a way to automatically associate dependencies according to the built-in injection rules Autowiring Entity class Rumenz.java package com.rumenz; public class Rumenz { private […]

  • Spring autowiring mode


    Dependency injection type Dependency injection type Examples of configuration metadata Setter method <proeprty name=”user” ref=”userBean”/> constructor <constructor-arg name=”user” ref=”userBean” /> field @Autowired User user; method @Autowired public void user(User user) { … } Interface callback class MyBean implements BeanFactoryAware { … } Autowiring mode Automatic binding is mainly used in XML mode pattern explain no […]

  • Spring setter method injection


    Setter method input Entity class Rumenz.java/Holder .java package com.rumenz; public class Rumenz { private Integer id; private String name; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } } package com.rumenz; public […]