* JAVA-19555 Move articles from spring-core-5 module to spring-boot-annotations-2 module * JAVA-19555 Move articles from spring-core module to spring-boot-annotations-2 module
20 lines
365 B
Java
20 lines
365 B
Java
package com.baeldung.lazy;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
|
public class Region {
|
|
|
|
@Lazy
|
|
@Autowired
|
|
private City city;
|
|
|
|
public Region() {
|
|
System.out.println("Region bean initialized");
|
|
}
|
|
|
|
public City getCityInstance() {
|
|
return city;
|
|
}
|
|
}
|