Home > Back-end >  Springboot how to use the code in the child thread out of a bean to? In addition to using the @autow
Springboot how to use the code in the child thread out of a bean to? In addition to using the @autow

Time:09-15

Springboot how to use the code in the child thread out of a bean to? In addition to using the @autowired
Just want to at any time can be like a new object, construct a bean to,

CodePudding user response:

refer to the original poster medical hand response:
Springboot how to use the code in the child thread out of a bean to? In addition to using the @autowired
Just want to at any time can be like a new object, construct a bean to

Think that the new new bai

CodePudding user response:

refer to the original poster medical hand response:
Springboot how to use the code in the child thread out of a bean to? In addition to using the @autowired
Just want to at any time can be like a new object, construct a bean to

Think that the new new bai

CodePudding user response:

Behind your posts related blogs in the first two:

https://blog.csdn.net/tanglihai/article/details/81353411? Utm_medium=distribute. Pc_relevant_bbs_down. None - task - blog - baidujs - 1. Nonecase& Depth_1 - utm_source=distribute. Pc_relevant_bbs_down. None - task - blog - baidujs - 1. Nonecase

https://blog.csdn.net/weixin_38207457/article/details/78292266? Utm_medium=distribute. Pc_relevant_bbs_down. None - task - blog - baidujs - 2. Nonecase& Depth_1 - utm_source=distribute. Pc_relevant_bbs_down. None - task - blog - baidujs - 2. Nonecase

CodePudding user response:

The realization of the child thread can continue new ah ~

CodePudding user response:

refer to the original poster medical hand response:
Springboot how to use the code in the child thread out of a bean to? In addition to using the @autowired
Just want to at any time can be like a new object, construct a bean to


Write a static method can each service:
 
@ Service
Public class ClueService extends BaseModel {

Public static ClueService the get () {
Return BeanContainer. GetBean (ClueService. Class. GetName ());
}

Public void save (Clue entity) {
//...
}

}

Other places you can write like this:
 
Clue entity=new Clue ();
The entity. The elegantly-named setName (" test ");
ClueService. The get (). The save (entity);

In short the @autowired is no longer necessary
  • Related