首页>代码>spring bean通过@Lazy注解实现延迟初始化实例>/lazy-initialize-@autowired-dependency-@lazy-example/src/main/java/com/memorynotfound/spring/core/lazy/Address.java
package com.memorynotfound.spring.core.lazy; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; import org.springframework.stereotype.Controller; import org.springframework.stereotype.Repository; import org.springframework.stereotype.Service; @Lazy //@Repository //@Component //@Controller @Service public class Address { public Address() { System.out.println("Address initialized"); } @Override public String toString() { return "Address is www.zuidaima.com"; } }
最近浏览更多
80730176 LV7
2023年11月28日
szf123 LV12
2023年5月30日
我睡觉时不困 LV7
2022年10月30日
2468867327 LV10
2022年5月17日
xp95323 LV14
2022年1月25日
最代码-宋家辉 LV61
2021年11月7日
好好必须的快乐
2021年10月30日
暂无贡献等级
moonquake_lin LV2
2021年9月8日
neikoneiko LV9
2021年6月4日
xiao菜 LV2
2021年6月2日