Browse Source

优化注入

zhangqiankun 3 years ago
parent
commit
d23c30ab34

+ 2 - 5
src/main/java/com/persagy/proxy/adm/strategy/RelationObjectContext.java

@@ -4,8 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
-import javax.annotation.Resource;
-
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -34,11 +33,9 @@ public class RelationObjectContext {
 	private Map<String, RelationObjectStrategy> relationObjectStrategyMap;
 	
 	/**
-	 * 自动注入 byName
-	 * 
 	 * @param relationObjectStrategyMap
 	 */
-	@Resource
+	@Autowired(required = false)
 	public void relationObjectStrategyMap(Map<String, RelationObjectStrategy> relationObjectStrategyMap) {
 		this.relationObjectStrategyMap = relationObjectStrategyMap;
 	}