persistence work

This commit is contained in:
eugenp
2015-08-16 11:30:03 +03:00
parent 393c1eac14
commit 446bf7fbbd
13 changed files with 98 additions and 26 deletions
@@ -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();
}
}
@@ -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();
}
@@ -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();
}
@@ -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();
}
@@ -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,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 {