Removed boilerplate code
This commit is contained in:
parent
bd53673e2b
commit
d27cbbc4a6
@ -14,12 +14,6 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
//@EnableAutoConfiguration(excludeName = {"org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration"})
|
||||
public class EmployeeApplication {
|
||||
public static void main(String[] args) {
|
||||
ApplicationContext context = SpringApplication.run(EmployeeApplication.class, args);
|
||||
System.out.println("Configures Employee: " + context.containsBeanDefinition("employee"));
|
||||
System.out.println("Configures Senior Employee: " + context.containsBeanDefinition("seniorEmployee"));
|
||||
System.out.println("Configures Doctor: " + context.containsBeanDefinition("doctor"));
|
||||
System.out.println("Configures Hospital: " + context.containsBeanDefinition("hospital"));
|
||||
System.out.println("Configures Student: " + context.containsBeanDefinition("student"));
|
||||
System.out.println("Configures Teacher: " + context.containsBeanDefinition("teacher"));
|
||||
SpringApplication.run(EmployeeApplication.class, args);
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,9 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("employee")
|
||||
public class Employee {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Employee" + this.hashCode();
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,9 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class SeniorEmployee {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Senior Employee" + this.hashCode();
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,9 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("student")
|
||||
public class Student {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Student" + this.hashCode();
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,9 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("teacher")
|
||||
public class Teacher {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Teacher" + this.hashCode();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user