persistence work
This commit is contained in:
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
package org.baeldung.properties.external;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.properties.core")
|
||||
@PropertySource("classpath:foo.properties")
|
||||
public class ExternalPropertiesWithJavaConfig {
|
||||
|
||||
public ExternalPropertiesWithJavaConfig() {
|
||||
super();
|
||||
}
|
||||
|
||||
// beans
|
||||
|
||||
@Bean
|
||||
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
|
||||
return new PropertySourcesPlaceholderConfigurer();
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -7,9 +7,9 @@ import org.springframework.context.annotation.ImportResource;
|
||||
@Configuration
|
||||
@ImportResource("classpath:configForProperties.xml")
|
||||
@ComponentScan("org.baeldung.core")
|
||||
public class PropertiesWithXmlConfig {
|
||||
public class ExternalPropertiesWithXmlConfig {
|
||||
|
||||
public PropertiesWithXmlConfig() {
|
||||
public ExternalPropertiesWithXmlConfig() {
|
||||
super();
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,9 +7,9 @@ import org.springframework.context.annotation.ImportResource;
|
||||
@Configuration
|
||||
@ImportResource("classpath:configForPropertiesOne.xml")
|
||||
@ComponentScan("org.baeldung.core")
|
||||
public class PropertiesWithXmlConfigOne {
|
||||
public class ExternalPropertiesWithXmlConfigOne {
|
||||
|
||||
public PropertiesWithXmlConfigOne() {
|
||||
public ExternalPropertiesWithXmlConfigOne() {
|
||||
super();
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
@Configuration
|
||||
@ImportResource("classpath:basicConfigForPropertiesTwo.xml")
|
||||
public class PropertiesWithXmlConfigTwo {
|
||||
public class ExternalPropertiesWithXmlConfigTwo {
|
||||
|
||||
public PropertiesWithXmlConfigTwo() {
|
||||
public ExternalPropertiesWithXmlConfigTwo() {
|
||||
super();
|
||||
}
|
||||
|
||||
-9
@@ -1,9 +1,7 @@
|
||||
package org.baeldung.properties.spring;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
||||
|
||||
@Configuration
|
||||
@PropertySource("classpath:foo.properties")
|
||||
@@ -13,11 +11,4 @@ public class BasicPropertiesWithJavaConfig {
|
||||
super();
|
||||
}
|
||||
|
||||
// beans
|
||||
|
||||
@Bean
|
||||
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
|
||||
return new PropertySourcesPlaceholderConfigurer();
|
||||
}
|
||||
|
||||
}
|
||||
+1
-3
@@ -1,13 +1,11 @@
|
||||
package org.baeldung.properties.external;
|
||||
package org.baeldung.properties.spring;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.properties.core")
|
||||
@PropertySource("classpath:foo.properties")
|
||||
public class PropertiesWithJavaConfig {
|
||||
|
||||
Reference in New Issue
Block a user