Package com.imyeyu.spring.annotation
Annotation Interface Entity
实体注解,Component 别名,只是为了在实体类注入服务接口(如果实体需要注入服务,需要这个类注解)
@Entity
@NoArgsConstructor // 需要个空的构造方法让 MyBatis 正常实例化
public class Entity {
@Transient
private transient static Service service;
// 通过构造方法注入
@Autowired
public Entity(Service service) {
Entity.service = service;
}
}
- Version:
- 2021-08-18 16:31
- Author:
- 夜雨
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String value设置控制反转 ID- Returns:
- 控制反转 ID
- Default:
""
-