This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.spring.basics.springin5steps.Scope; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.stereotype.Component; | |
| @Component | |
| public class PersonDAO { | |
| @Autowired | |
| JdbcConnection jdbcConnection; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.spring.basics.springin5steps.Scope; | |
| import org.springframework.stereotype.Component; | |
| @Component | |
| public class JdbcConnection { | |
| public JdbcConnection() { | |
| System.out.println("JDBC Connection"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.spring.basics.springin5steps; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.context.ApplicationContext; | |
| import com.pig.spring.basics.springin5steps.Scope.PersonDAO; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.spring.basics.springin5steps.Scope; | |
| import org.springframework.beans.factory.config.ConfigurableBeanFactory; | |
| import org.springframework.context.annotation.Scope; | |
| import org.springframework.stereotype.Component; | |
| @Component | |
| @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) | |
| public class JdbcConnection { | |
| public JdbcConnection() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.spring.basics.springin5steps.Scope; | |
| import org.springframework.beans.factory.config.ConfigurableBeanFactory; | |
| import org.springframework.context.annotation.Scope; | |
| import org.springframework.context.annotation.ScopedProxyMode; | |
| import org.springframework.stereotype.Component; | |
| @Component | |
| @Scope(value=ConfigurableBeanFactory.SCOPE_PROTOTYPE, | |
| proxyMode = ScopedProxyMode.TARGET_CLASS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.spring.basics.springin5steps; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.context.ApplicationContext; | |
| import com.pig.spring.basics.springin5steps.Scope.PersonDAO; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.spring.basics.componentscan; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.stereotype.Component; | |
| @Component | |
| public class ComponentDAO { | |
| @Autowired | |
| ComponentJdbcConnection jdbcConnection; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.spring.basics.componentscan; | |
| import org.springframework.beans.factory.config.ConfigurableBeanFactory; | |
| import org.springframework.context.annotation.Scope; | |
| import org.springframework.context.annotation.ScopedProxyMode; | |
| import org.springframework.stereotype.Component; | |
| @Component | |
| @Scope(value=ConfigurableBeanFactory.SCOPE_PROTOTYPE, | |
| proxyMode = ScopedProxyMode.TARGET_CLASS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.spring.basics.springin5steps; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.context.ApplicationContext; | |
| import org.springframework.context.annotation.ComponentScan; | |
| import com.pig.spring.basics.componentscan.ComponentDAO; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.spring.basics.springin5steps; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.context.ApplicationContext; | |
| import org.springframework.context.annotation.ComponentScan; | |
| import com.pig.spring.basics.componentscan.ComponentDAO; |