BAEL-20262: Migrate spring-exceptions module to the com.baeldung package
This commit is contained in:
parent
b8e73d5b8c
commit
98bdc464da
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beancreationexception.cause1;
|
||||
package com.baeldung.ex.beancreationexception.cause1;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
|
@ -0,0 +1,5 @@
|
|||
package com.baeldung.ex.beancreationexception.cause1;
|
||||
|
||||
public class BeanB {
|
||||
//
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beancreationexception.cause2;
|
||||
package com.baeldung.ex.beancreationexception.cause2;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beancreationexception.cause2;
|
||||
package com.baeldung.ex.beancreationexception.cause2;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beancreationexception.cause2;
|
||||
package com.baeldung.ex.beancreationexception.cause2;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.baeldung.ex.beancreationexception.cause2;
|
||||
|
||||
public interface IBeanB {
|
||||
//
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beancreationexception.cause3;
|
||||
package com.baeldung.ex.beancreationexception.cause3;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beancreationexception.cause4;
|
||||
package com.baeldung.ex.beancreationexception.cause4;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.baeldung.ex.beancreationexception.cause4;
|
||||
|
||||
public interface IBeanA {
|
||||
//
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beancreationexception.cause5;
|
||||
package com.baeldung.ex.beancreationexception.cause5;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.baeldung.ex.beancreationexception.cause5;
|
||||
|
||||
public interface IBeanA {
|
||||
//
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beancreationexception.cause6;
|
||||
package com.baeldung.ex.beancreationexception.cause6;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beancreationexception.cause6;
|
||||
package com.baeldung.ex.beancreationexception.cause6;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.baeldung.ex.beancreationexception.cause6;
|
||||
|
||||
public interface IBeanB {
|
||||
//
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beancreationexception.cause8;
|
||||
package com.baeldung.ex.beancreationexception.cause8;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beancreationexception.cause8;
|
||||
package com.baeldung.ex.beancreationexception.cause8;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
|
@ -0,0 +1,5 @@
|
|||
package com.baeldung.ex.beancreationexception.cause8;
|
||||
|
||||
public interface IBeanA {
|
||||
//
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.baeldung.ex.beancreationexception.cause8;
|
||||
|
||||
public interface IBeanB {
|
||||
//
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beancreationexception.cause9;
|
||||
package com.baeldung.ex.beancreationexception.cause9;
|
||||
|
||||
public abstract class BeanA implements IBeanA {
|
||||
//
|
|
@ -0,0 +1,5 @@
|
|||
package com.baeldung.ex.beancreationexception.cause9;
|
||||
|
||||
public class BeanB {
|
||||
//
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.baeldung.ex.beancreationexception.cause9;
|
||||
|
||||
public interface IBeanA {
|
||||
//
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.ex.beancreationexception.spring;
|
||||
package com.baeldung.ex.beancreationexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.beancreationexception.cause1")
|
||||
@ComponentScan("com.baeldung.ex.beancreationexception.cause1")
|
||||
public class Cause1ContextWithJavaConfig {
|
||||
|
||||
public Cause1ContextWithJavaConfig() {
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.ex.beancreationexception.spring;
|
||||
package com.baeldung.ex.beancreationexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.beancreationexception.cause2")
|
||||
@ComponentScan("com.baeldung.ex.beancreationexception.cause2")
|
||||
public class Cause2ContextWithJavaConfig {
|
||||
|
||||
public Cause2ContextWithJavaConfig() {
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.ex.beancreationexception.spring;
|
||||
package com.baeldung.ex.beancreationexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.beancreationexception.cause3")
|
||||
@ComponentScan("com.baeldung.ex.beancreationexception.cause3")
|
||||
public class Cause3ContextWithJavaConfig {
|
||||
|
||||
public Cause3ContextWithJavaConfig() {
|
|
@ -1,11 +1,11 @@
|
|||
package org.baeldung.ex.beancreationexception.spring;
|
||||
package com.baeldung.ex.beancreationexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.beancreationexception.cause4")
|
||||
@ComponentScan("com.baeldung.ex.beancreationexception.cause4")
|
||||
@ImportResource("classpath:beancreationexception_cause4.xml")
|
||||
public class Cause4ContextWithJavaConfig {
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.ex.beancreationexception.spring;
|
||||
package com.baeldung.ex.beancreationexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.beancreationexception.cause5")
|
||||
@ComponentScan("com.baeldung.ex.beancreationexception.cause5")
|
||||
public class Cause5ContextWithJavaConfig {
|
||||
|
||||
public Cause5ContextWithJavaConfig() {
|
|
@ -1,11 +1,11 @@
|
|||
package org.baeldung.ex.beancreationexception.spring;
|
||||
package com.baeldung.ex.beancreationexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.beancreationexception.cause6")
|
||||
@ComponentScan("com.baeldung.ex.beancreationexception.cause6")
|
||||
@ImportResource("classpath:beancreationexception_cause6.xml")
|
||||
public class Cause6ContextWithJavaConfig {
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
package org.baeldung.ex.beancreationexception.spring;
|
||||
package com.baeldung.ex.beancreationexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.beancreationexception.cause7")
|
||||
@ComponentScan("com.baeldung.ex.beancreationexception.cause7")
|
||||
@ImportResource("classpath:beancreationexception_cause7.xml")
|
||||
public class Cause7ContextWithJavaConfig {
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.ex.beancreationexception.spring;
|
||||
package com.baeldung.ex.beancreationexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.beancreationexception.cause8")
|
||||
@ComponentScan("com.baeldung.ex.beancreationexception.cause8")
|
||||
public class Cause8ContextWithJavaConfig {
|
||||
|
||||
public Cause8ContextWithJavaConfig() {
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung.ex.beancreationexception.spring;
|
||||
package com.baeldung.ex.beancreationexception.spring;
|
||||
|
||||
import org.baeldung.ex.beancreationexception.cause9.BeanB;
|
||||
import com.baeldung.ex.beancreationexception.cause9.BeanB;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration;
|
|||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.beancreationexception.cause9")
|
||||
@ComponentScan("com.baeldung.ex.beancreationexception.cause9")
|
||||
@ImportResource("classpath:beancreationexception_cause9.xml")
|
||||
public class Cause9ContextWithJavaConfig {
|
||||
@Autowired
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beandefinitionstoreexception.cause2;
|
||||
package com.baeldung.ex.beandefinitionstoreexception.cause2;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
|
@ -1,11 +1,11 @@
|
|||
package org.baeldung.ex.beandefinitionstoreexception.spring;
|
||||
package com.baeldung.ex.beandefinitionstoreexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.beandefinitionstoreexception.cause1")
|
||||
@ComponentScan("com.baeldung.ex.beandefinitionstoreexception.cause1")
|
||||
@ImportResource("beans.xml")
|
||||
public class Cause1ContextWithJavaConfig {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.beandefinitionstoreexception.spring;
|
||||
package com.baeldung.ex.beandefinitionstoreexception.spring;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
@ -7,7 +7,7 @@ import org.springframework.context.annotation.Configuration;
|
|||
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.beandefinitionstoreexception.cause2")
|
||||
@ComponentScan("com.baeldung.ex.beandefinitionstoreexception.cause2")
|
||||
public class Cause2ContextWithJavaConfig {
|
||||
|
||||
@Value("${some.property}")
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.ex.beandefinitionstoreexception.spring;
|
||||
package com.baeldung.ex.beandefinitionstoreexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.beandefinitionstoreexception.cause3")
|
||||
@ComponentScan("com.baeldung.ex.beandefinitionstoreexception.cause3")
|
||||
public class Cause3ContextWithJavaConfig {
|
||||
|
||||
public Cause3ContextWithJavaConfig() {
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung.ex.dataintegrityviolationexception.spring;
|
||||
package com.baeldung.ex.dataintegrityviolationexception.spring;
|
||||
|
||||
import org.baeldung.spring.config.PersistenceConfig;
|
||||
import com.baeldung.spring.config.PersistenceConfig;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -8,7 +8,7 @@ import org.springframework.context.annotation.Import;
|
|||
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.dataIntegrityviolationexception.cause1")
|
||||
@ComponentScan("com.baeldung.ex.dataIntegrityviolationexception.cause1")
|
||||
@Import(PersistenceConfig.class)
|
||||
public class Cause1DataContextWithJavaConfig {
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
package org.baeldung.ex.dataintegrityviolationexception.spring;
|
||||
package com.baeldung.ex.dataintegrityviolationexception.spring;
|
||||
|
||||
import org.baeldung.spring.config.PersistenceConfig;
|
||||
import com.baeldung.spring.config.PersistenceConfig;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.dataIntegrityviolationexception.cause2")
|
||||
@ComponentScan("com.baeldung.ex.dataIntegrityviolationexception.cause2")
|
||||
@Import(PersistenceConfig.class)
|
||||
public class Cause2DataContextWithJavaConfig {
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
package org.baeldung.ex.dataintegrityviolationexception.spring;
|
||||
package com.baeldung.ex.dataintegrityviolationexception.spring;
|
||||
|
||||
import org.baeldung.spring.config.PersistenceConfig;
|
||||
import com.baeldung.spring.config.PersistenceConfig;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.dataIntegrityviolationexception.cause3")
|
||||
@ComponentScan("com.baeldung.ex.dataIntegrityviolationexception.cause3")
|
||||
@Import(PersistenceConfig.class)
|
||||
public class Cause3DataContextWithJavaConfig {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.mappingexception.cause1.persistence.model;
|
||||
package com.baeldung.ex.mappingexception.cause1.persistence.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.mappingexception.cause2.persistence.model;
|
||||
package com.baeldung.ex.mappingexception.cause2.persistence.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.mappingexception.cause3.persistence.model;
|
||||
package com.baeldung.ex.mappingexception.cause3.persistence.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.mappingexception.cause4.persistence.model;
|
||||
package com.baeldung.ex.mappingexception.cause4.persistence.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.mappingexception.spring;
|
||||
package com.baeldung.ex.mappingexception.spring;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
@ -21,7 +21,7 @@ import com.google.common.base.Preconditions;
|
|||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@PropertySource({ "classpath:persistence-mysql.properties" })
|
||||
@ComponentScan({ "org.baeldung.ex.mappingexception.cause1.persistence" })
|
||||
@ComponentScan({ "com.baeldung.ex.mappingexception.cause1.persistence" })
|
||||
public class Cause1PersistenceConfig {
|
||||
|
||||
@Autowired
|
||||
|
@ -35,7 +35,7 @@ public class Cause1PersistenceConfig {
|
|||
public LocalSessionFactoryBean sessionFactory() {
|
||||
final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
|
||||
sessionFactory.setDataSource(restDataSource());
|
||||
sessionFactory.setPackagesToScan(new String[] { "org.baeldung.ex.mappingexception.cause1.persistence.model" });
|
||||
sessionFactory.setPackagesToScan(new String[] { "com.baeldung.ex.mappingexception.cause1.persistence.model" });
|
||||
sessionFactory.setHibernateProperties(hibernateProperties());
|
||||
|
||||
return sessionFactory;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.mappingexception.spring;
|
||||
package com.baeldung.ex.mappingexception.spring;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
@ -21,7 +21,7 @@ import com.google.common.base.Preconditions;
|
|||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@PropertySource({ "classpath:persistence-mysql.properties" })
|
||||
@ComponentScan({ "org.baeldung.ex.mappingexception.cause2.persistence" })
|
||||
@ComponentScan({ "com.baeldung.ex.mappingexception.cause2.persistence" })
|
||||
public class Cause2PersistenceConfig {
|
||||
|
||||
@Autowired
|
||||
|
@ -37,7 +37,7 @@ public class Cause2PersistenceConfig {
|
|||
sessionFactory.setDataSource(restDataSource());
|
||||
sessionFactory.setHibernateProperties(hibernateProperties());
|
||||
|
||||
// sessionFactory.setPackagesToScan(new String[] { "org.baeldung.ex.mappingexception.cause2.persistence.model" });
|
||||
// sessionFactory.setPackagesToScan(new String[] { "com.baeldung.ex.mappingexception.cause2.persistence.model" });
|
||||
// sessionFactory.setAnnotatedClasses(new Class[] { Foo.class });
|
||||
|
||||
return sessionFactory;
|
|
@ -1,11 +1,11 @@
|
|||
package org.baeldung.ex.mappingexception.spring;
|
||||
package com.baeldung.ex.mappingexception.spring;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.tomcat.dbcp.dbcp.BasicDataSource;
|
||||
import org.baeldung.ex.mappingexception.cause3.persistence.model.Foo;
|
||||
import com.baeldung.ex.mappingexception.cause3.persistence.model.Foo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
@ -22,7 +22,7 @@ import com.google.common.base.Preconditions;
|
|||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@PropertySource({ "classpath:persistence-mysql.properties" })
|
||||
@ComponentScan({ "org.baeldung.ex.mappingexception.cause2.persistence" })
|
||||
@ComponentScan({ "com.baeldung.ex.mappingexception.cause2.persistence" })
|
||||
public class Cause3PersistenceConfig {
|
||||
|
||||
@Autowired
|
||||
|
@ -38,7 +38,7 @@ public class Cause3PersistenceConfig {
|
|||
sessionFactory.setDataSource(restDataSource());
|
||||
sessionFactory.setHibernateProperties(hibernateProperties());
|
||||
|
||||
// sessionFactory.setPackagesToScan(new String[] { "org.baeldung.ex.mappingexception.cause2.persistence.model" });
|
||||
// sessionFactory.setPackagesToScan(new String[] { "com.baeldung.ex.mappingexception.cause2.persistence.model" });
|
||||
sessionFactory.setAnnotatedClasses(new Class[] { Foo.class });
|
||||
|
||||
return sessionFactory;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.nontransientexception.cause;
|
||||
package com.baeldung.ex.nontransientexception.cause;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
@ -21,7 +21,7 @@ import com.google.common.base.Preconditions;
|
|||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@PropertySource({ "classpath:persistence-derby.properties" })
|
||||
@ComponentScan({ "org.baeldung.persistence" })
|
||||
@ComponentScan({ "com.baeldung.persistence" })
|
||||
public class Cause1NonTransientConfig {
|
||||
|
||||
@Autowired
|
||||
|
@ -35,7 +35,7 @@ public class Cause1NonTransientConfig {
|
|||
public LocalSessionFactoryBean sessionFactory() {
|
||||
final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
|
||||
sessionFactory.setDataSource(restDataSource());
|
||||
sessionFactory.setPackagesToScan(new String[] { "org.baeldung.persistence.model" });
|
||||
sessionFactory.setPackagesToScan(new String[] { "com.baeldung.persistence.model" });
|
||||
sessionFactory.setHibernateProperties(hibernateProperties());
|
||||
|
||||
return sessionFactory;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.nontransientexception.cause;
|
||||
package com.baeldung.ex.nontransientexception.cause;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
@ -21,7 +21,7 @@ import com.google.common.base.Preconditions;
|
|||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@PropertySource({ "classpath:persistence-derby.properties" })
|
||||
@ComponentScan({ "org.baeldung.persistence" })
|
||||
@ComponentScan({ "com.baeldung.persistence" })
|
||||
public class Cause4NonTransientConfig {
|
||||
|
||||
@Autowired
|
||||
|
@ -35,7 +35,7 @@ public class Cause4NonTransientConfig {
|
|||
public LocalSessionFactoryBean sessionFactory() {
|
||||
final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
|
||||
sessionFactory.setDataSource(restDataSource());
|
||||
sessionFactory.setPackagesToScan(new String[] { "org.baeldung.persistence.model" });
|
||||
sessionFactory.setPackagesToScan(new String[] { "com.baeldung.persistence.model" });
|
||||
sessionFactory.setHibernateProperties(hibernateProperties());
|
||||
|
||||
return sessionFactory;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.nontransientexception.cause;
|
||||
package com.baeldung.ex.nontransientexception.cause;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
@ -21,7 +21,7 @@ import com.google.common.base.Preconditions;
|
|||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@PropertySource({ "classpath:persistence-mysql-incorrect.properties" })
|
||||
@ComponentScan({ "org.baeldung.persistence" })
|
||||
@ComponentScan({ "com.baeldung.persistence" })
|
||||
public class Cause5NonTransientConfig {
|
||||
|
||||
@Autowired
|
||||
|
@ -35,7 +35,7 @@ public class Cause5NonTransientConfig {
|
|||
public LocalSessionFactoryBean sessionFactory() {
|
||||
final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
|
||||
sessionFactory.setDataSource(restDataSource());
|
||||
sessionFactory.setPackagesToScan(new String[] { "org.baeldung.persistence.model" });
|
||||
sessionFactory.setPackagesToScan(new String[] { "com.baeldung.persistence.model" });
|
||||
sessionFactory.setHibernateProperties(hibernateProperties());
|
||||
|
||||
return sessionFactory;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.nosuchbeandefinitionexception.cause1;
|
||||
package com.baeldung.ex.nosuchbeandefinitionexception.cause1;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
|
@ -0,0 +1,5 @@
|
|||
package com.baeldung.ex.nosuchbeandefinitionexception.cause1;
|
||||
|
||||
public class BeanB {
|
||||
//
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.nosuchbeandefinitionexception.cause2;
|
||||
package com.baeldung.ex.nosuchbeandefinitionexception.cause2;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.nosuchbeandefinitionexception.cause2;
|
||||
package com.baeldung.ex.nosuchbeandefinitionexception.cause2;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.nosuchbeandefinitionexception.cause2;
|
||||
package com.baeldung.ex.nosuchbeandefinitionexception.cause2;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.baeldung.ex.nosuchbeandefinitionexception.cause2;
|
||||
|
||||
public interface IBeanB {
|
||||
//
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.ex.nosuchbeandefinitionexception.cause3;
|
||||
package com.baeldung.ex.nosuchbeandefinitionexception.cause3;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.ex.nosuchbeandefinitionexception.spring;
|
||||
package com.baeldung.ex.nosuchbeandefinitionexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.nosuchbeandefinitionexception.cause1")
|
||||
@ComponentScan("com.baeldung.ex.nosuchbeandefinitionexception.cause1")
|
||||
public class Cause1ContextWithJavaConfig {
|
||||
|
||||
public Cause1ContextWithJavaConfig() {
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.ex.nosuchbeandefinitionexception.spring;
|
||||
package com.baeldung.ex.nosuchbeandefinitionexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.nosuchbeandefinitionexception.cause2")
|
||||
@ComponentScan("com.baeldung.ex.nosuchbeandefinitionexception.cause2")
|
||||
public class Cause2ContextWithJavaConfig {
|
||||
|
||||
public Cause2ContextWithJavaConfig() {
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.ex.nosuchbeandefinitionexception.spring;
|
||||
package com.baeldung.ex.nosuchbeandefinitionexception.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.ex.nosuchbeandefinitionexception.cause3")
|
||||
@ComponentScan("com.baeldung.ex.nosuchbeandefinitionexception.cause3")
|
||||
public class Cause3ContextWithJavaConfig {
|
||||
|
||||
public Cause3ContextWithJavaConfig() {
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.persistence;
|
||||
package com.baeldung.persistence;
|
||||
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.persistence.common;
|
||||
package com.baeldung.persistence.common;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
|
@ -1,9 +1,8 @@
|
|||
package org.baeldung.persistence.common;
|
||||
package com.baeldung.persistence.common;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.baeldung.persistence.common.IOperations;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Transactional
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.persistence.common;
|
||||
package com.baeldung.persistence.common;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
|
@ -0,0 +1,8 @@
|
|||
package com.baeldung.persistence.dao;
|
||||
|
||||
import com.baeldung.persistence.common.IOperations;
|
||||
import com.baeldung.persistence.model.Child;
|
||||
|
||||
public interface IChildDao extends IOperations<Child> {
|
||||
//
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.baeldung.persistence.dao;
|
||||
|
||||
import com.baeldung.persistence.common.IOperations;
|
||||
import com.baeldung.persistence.model.Foo;
|
||||
|
||||
public interface IFooDao extends IOperations<Foo> {
|
||||
//
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.baeldung.persistence.dao;
|
||||
|
||||
import com.baeldung.persistence.common.IOperations;
|
||||
import com.baeldung.persistence.model.Parent;
|
||||
|
||||
public interface IParentDao extends IOperations<Parent> {
|
||||
//
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
package org.baeldung.persistence.dao.impl;
|
||||
package com.baeldung.persistence.dao.impl;
|
||||
|
||||
import org.baeldung.persistence.common.AbstractHibernateDao;
|
||||
import org.baeldung.persistence.dao.IChildDao;
|
||||
import org.baeldung.persistence.model.Child;
|
||||
import com.baeldung.persistence.common.AbstractHibernateDao;
|
||||
import com.baeldung.persistence.model.Child;
|
||||
import com.baeldung.persistence.dao.IChildDao;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
|
@ -1,8 +1,8 @@
|
|||
package org.baeldung.persistence.dao.impl;
|
||||
package com.baeldung.persistence.dao.impl;
|
||||
|
||||
import org.baeldung.persistence.common.AbstractHibernateDao;
|
||||
import org.baeldung.persistence.dao.IFooDao;
|
||||
import org.baeldung.persistence.model.Foo;
|
||||
import com.baeldung.persistence.common.AbstractHibernateDao;
|
||||
import com.baeldung.persistence.dao.IFooDao;
|
||||
import com.baeldung.persistence.model.Foo;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
|
@ -1,8 +1,8 @@
|
|||
package org.baeldung.persistence.dao.impl;
|
||||
package com.baeldung.persistence.dao.impl;
|
||||
|
||||
import org.baeldung.persistence.common.AbstractHibernateDao;
|
||||
import org.baeldung.persistence.dao.IParentDao;
|
||||
import org.baeldung.persistence.model.Parent;
|
||||
import com.baeldung.persistence.common.AbstractHibernateDao;
|
||||
import com.baeldung.persistence.model.Parent;
|
||||
import com.baeldung.persistence.dao.IParentDao;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.persistence.model;
|
||||
package com.baeldung.persistence.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.persistence.model;
|
||||
package com.baeldung.persistence.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.persistence.model;
|
||||
package com.baeldung.persistence.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.baeldung.persistence.service;
|
||||
|
||||
import com.baeldung.persistence.common.IOperations;
|
||||
import com.baeldung.persistence.model.Child;
|
||||
|
||||
public interface IChildService extends IOperations<Child> {
|
||||
//
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.baeldung.persistence.service;
|
||||
|
||||
import com.baeldung.persistence.common.IOperations;
|
||||
import com.baeldung.persistence.model.Foo;
|
||||
|
||||
public interface IFooService extends IOperations<Foo> {
|
||||
//
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.baeldung.persistence.service;
|
||||
|
||||
import com.baeldung.persistence.common.IOperations;
|
||||
import com.baeldung.persistence.model.Parent;
|
||||
|
||||
public interface IParentService extends IOperations<Parent> {
|
||||
//
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.persistence.service.impl;
|
||||
package com.baeldung.persistence.service.impl;
|
||||
|
||||
import org.baeldung.persistence.common.AbstractService;
|
||||
import org.baeldung.persistence.common.IOperations;
|
||||
import org.baeldung.persistence.dao.IChildDao;
|
||||
import org.baeldung.persistence.model.Child;
|
||||
import org.baeldung.persistence.service.IChildService;
|
||||
import com.baeldung.persistence.common.AbstractService;
|
||||
import com.baeldung.persistence.common.IOperations;
|
||||
import com.baeldung.persistence.service.IChildService;
|
||||
import com.baeldung.persistence.dao.IChildDao;
|
||||
import com.baeldung.persistence.model.Child;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.persistence.service.impl;
|
||||
package com.baeldung.persistence.service.impl;
|
||||
|
||||
import org.baeldung.persistence.common.AbstractService;
|
||||
import org.baeldung.persistence.common.IOperations;
|
||||
import org.baeldung.persistence.dao.IFooDao;
|
||||
import org.baeldung.persistence.model.Foo;
|
||||
import org.baeldung.persistence.service.IFooService;
|
||||
import com.baeldung.persistence.common.AbstractService;
|
||||
import com.baeldung.persistence.common.IOperations;
|
||||
import com.baeldung.persistence.service.IFooService;
|
||||
import com.baeldung.persistence.dao.IFooDao;
|
||||
import com.baeldung.persistence.model.Foo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
package org.baeldung.persistence.service.impl;
|
||||
package com.baeldung.persistence.service.impl;
|
||||
|
||||
import org.baeldung.persistence.common.AbstractService;
|
||||
import org.baeldung.persistence.common.IOperations;
|
||||
import org.baeldung.persistence.dao.IParentDao;
|
||||
import org.baeldung.persistence.model.Parent;
|
||||
import org.baeldung.persistence.service.IParentService;
|
||||
import com.baeldung.persistence.common.AbstractService;
|
||||
import com.baeldung.persistence.common.IOperations;
|
||||
import com.baeldung.persistence.model.Parent;
|
||||
import com.baeldung.persistence.service.IParentService;
|
||||
import com.baeldung.persistence.dao.IParentDao;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.properties.core;
|
||||
package com.baeldung.properties.core;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.properties.core;
|
||||
package com.baeldung.properties.core;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.properties.spring;
|
||||
package com.baeldung.properties.spring;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
@ -7,7 +7,7 @@ import org.springframework.context.annotation.PropertySource;
|
|||
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.properties.core")
|
||||
@ComponentScan("com.baeldung.properties.core")
|
||||
@PropertySource("classpath:foo.properties")
|
||||
public class PropertiesWithJavaConfig {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.properties.spring;
|
||||
package com.baeldung.properties.spring;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.properties.spring;
|
||||
package com.baeldung.properties.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -6,7 +6,7 @@ import org.springframework.context.annotation.ImportResource;
|
|||
|
||||
@Configuration
|
||||
@ImportResource("classpath:configForProperties.xml")
|
||||
@ComponentScan("org.baeldung.core")
|
||||
@ComponentScan("com.baeldung.core")
|
||||
public class PropertiesWithXmlConfig {
|
||||
|
||||
public PropertiesWithXmlConfig() {
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.properties.spring;
|
||||
package com.baeldung.properties.spring;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -6,7 +6,7 @@ import org.springframework.context.annotation.ImportResource;
|
|||
|
||||
@Configuration
|
||||
@ImportResource("classpath:configForPropertiesOne.xml")
|
||||
@ComponentScan("org.baeldung.core")
|
||||
@ComponentScan("com.baeldung.core")
|
||||
public class PropertiesWithXmlConfigOne {
|
||||
|
||||
public PropertiesWithXmlConfigOne() {
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.properties.spring;
|
||||
package com.baeldung.properties.spring;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
|
@ -1,11 +1,11 @@
|
|||
package org.baeldung.spring.config;
|
||||
package com.baeldung.spring.config;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.core")
|
||||
@ComponentScan("com.baeldung.core")
|
||||
public class CoreConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
public CoreConfig() {
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring.config;
|
||||
package com.baeldung.spring.config;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class MainWebAppInitializer implements WebApplicationInitializer {
|
|||
|
||||
// Create the 'root' Spring application context
|
||||
final AnnotationConfigWebApplicationContext root = new AnnotationConfigWebApplicationContext();
|
||||
root.scan("org.baeldung.spring.config");
|
||||
root.scan("com.baeldung.spring.config");
|
||||
// root.getEnvironment().setDefaultProfiles("embedded");
|
||||
|
||||
// Manages the lifecycle of the root application context
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring.config;
|
||||
package com.baeldung.spring.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.spring.config;
|
||||
package com.baeldung.spring.config;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
@ -21,7 +21,7 @@ import com.google.common.base.Preconditions;
|
|||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@PropertySource({ "classpath:persistence-mysql.properties" })
|
||||
@ComponentScan({ "org.baeldung.persistence" })
|
||||
@ComponentScan({ "com.baeldung.persistence" })
|
||||
public class PersistenceConfig {
|
||||
|
||||
@Autowired
|
||||
|
@ -35,7 +35,7 @@ public class PersistenceConfig {
|
|||
public LocalSessionFactoryBean sessionFactory() {
|
||||
final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
|
||||
sessionFactory.setDataSource(restDataSource());
|
||||
sessionFactory.setPackagesToScan(new String[] { "org.baeldung.persistence.model" });
|
||||
sessionFactory.setPackagesToScan(new String[] { "com.baeldung.persistence.model" });
|
||||
sessionFactory.setHibernateProperties(hibernateProperties());
|
||||
|
||||
return sessionFactory;
|
|
@ -1,5 +0,0 @@
|
|||
package org.baeldung.ex.beancreationexception.cause1;
|
||||
|
||||
public class BeanB {
|
||||
//
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package org.baeldung.ex.beancreationexception.cause2;
|
||||
|
||||
public interface IBeanB {
|
||||
//
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package org.baeldung.ex.beancreationexception.cause4;
|
||||
|
||||
public interface IBeanA {
|
||||
//
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package org.baeldung.ex.beancreationexception.cause5;
|
||||
|
||||
public interface IBeanA {
|
||||
//
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package org.baeldung.ex.beancreationexception.cause6;
|
||||
|
||||
public interface IBeanB {
|
||||
//
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package org.baeldung.ex.beancreationexception.cause8;
|
||||
|
||||
public interface IBeanA {
|
||||
//
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package org.baeldung.ex.beancreationexception.cause8;
|
||||
|
||||
public interface IBeanB {
|
||||
//
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package org.baeldung.ex.beancreationexception.cause9;
|
||||
|
||||
public class BeanB {
|
||||
//
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package org.baeldung.ex.beancreationexception.cause9;
|
||||
|
||||
public interface IBeanA {
|
||||
//
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package org.baeldung.ex.nosuchbeandefinitionexception.cause1;
|
||||
|
||||
public class BeanB {
|
||||
//
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package org.baeldung.ex.nosuchbeandefinitionexception.cause2;
|
||||
|
||||
public interface IBeanB {
|
||||
//
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package org.baeldung.persistence.dao;
|
||||
|
||||
import org.baeldung.persistence.common.IOperations;
|
||||
import org.baeldung.persistence.model.Child;
|
||||
|
||||
public interface IChildDao extends IOperations<Child> {
|
||||
//
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package org.baeldung.persistence.dao;
|
||||
|
||||
import org.baeldung.persistence.common.IOperations;
|
||||
import org.baeldung.persistence.model.Foo;
|
||||
|
||||
public interface IFooDao extends IOperations<Foo> {
|
||||
//
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue