[JAVA-28184] (#15366)
* [JAVA-28184] Moved code for article(Custom Naming Convention with Spring Data JPA) to spring-data-jpa-enterprise-2 * [JAVA-28184] Moved code for article(Working with Lazy Element Collections in JPA) to spring-data-jpa-enterprise-2
This commit is contained in:
		
							parent
							
								
									d1661c2bc7
								
							
						
					
					
						commit
						b792a6e5ee
					
				| @ -3,7 +3,8 @@ | |||||||
| This module contains articles about Spring Data JPA used in enterprise applications such as transactions, sessions, naming conventions and more  | This module contains articles about Spring Data JPA used in enterprise applications such as transactions, sessions, naming conventions and more  | ||||||
| 
 | 
 | ||||||
| ### Relevant Articles:  | ### Relevant Articles:  | ||||||
| 
 | - [Custom Naming Convention with Spring Data JPA](https://www.baeldung.com/spring-data-jpa-custom-naming) | ||||||
|  | - [Working with Lazy Element Collections in JPA](https://www.baeldung.com/java-jpa-lazy-collections) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| ### Eclipse Config  | ### Eclipse Config  | ||||||
|  | |||||||
| @ -1,9 +1,14 @@ | |||||||
| package com.baeldung.elementcollection.model; | package com.baeldung.elementcollection.model; | ||||||
| 
 | 
 | ||||||
| import javax.persistence.*; |  | ||||||
| import java.util.List; | import java.util.List; | ||||||
| import java.util.Objects; | import java.util.Objects; | ||||||
| 
 | 
 | ||||||
|  | import javax.persistence.CollectionTable; | ||||||
|  | import javax.persistence.ElementCollection; | ||||||
|  | import javax.persistence.Entity; | ||||||
|  | import javax.persistence.Id; | ||||||
|  | import javax.persistence.JoinColumn; | ||||||
|  | 
 | ||||||
| @Entity | @Entity | ||||||
| public class Employee { | public class Employee { | ||||||
|     @Id |     @Id | ||||||
| @ -1,8 +1,9 @@ | |||||||
| package com.baeldung.elementcollection.model; | package com.baeldung.elementcollection.model; | ||||||
| 
 | 
 | ||||||
| import javax.persistence.Embeddable; |  | ||||||
| import java.util.Objects; | import java.util.Objects; | ||||||
| 
 | 
 | ||||||
|  | import javax.persistence.Embeddable; | ||||||
|  | 
 | ||||||
| @Embeddable | @Embeddable | ||||||
| public class Phone { | public class Phone { | ||||||
|     private String type; |     private String type; | ||||||
| @ -1,14 +1,16 @@ | |||||||
| package com.baeldung.elementcollection.repository; | package com.baeldung.elementcollection.repository; | ||||||
| 
 | 
 | ||||||
| import com.baeldung.elementcollection.model.Employee; | import java.util.HashMap; | ||||||
| import org.springframework.stereotype.Repository; | import java.util.Map; | ||||||
| import org.springframework.transaction.annotation.Transactional; |  | ||||||
| 
 | 
 | ||||||
| import javax.persistence.EntityGraph; | import javax.persistence.EntityGraph; | ||||||
| import javax.persistence.EntityManager; | import javax.persistence.EntityManager; | ||||||
| import javax.persistence.PersistenceContext; | import javax.persistence.PersistenceContext; | ||||||
| import java.util.HashMap; | 
 | ||||||
| import java.util.Map; | import org.springframework.stereotype.Repository; | ||||||
|  | import org.springframework.transaction.annotation.Transactional; | ||||||
|  | 
 | ||||||
|  | import com.baeldung.elementcollection.model.Employee; | ||||||
| 
 | 
 | ||||||
| @Repository | @Repository | ||||||
| public class EmployeeRepository { | public class EmployeeRepository { | ||||||
| @ -1,6 +1,5 @@ | |||||||
| package com.baeldung.namingstrategy; | package com.baeldung.namingstrategy; | ||||||
| 
 | 
 | ||||||
| import javax.persistence.Column; |  | ||||||
| import javax.persistence.Entity; | import javax.persistence.Entity; | ||||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||||
| 
 | 
 | ||||||
| @ -1,8 +1,10 @@ | |||||||
| package com.baeldung.elementcollection; | package com.baeldung.elementcollection; | ||||||
| 
 | 
 | ||||||
| import com.baeldung.elementcollection.model.Employee; | import static org.hamcrest.core.Is.is; | ||||||
| import com.baeldung.elementcollection.model.Phone; | import static org.junit.Assert.assertThat; | ||||||
| import com.baeldung.elementcollection.repository.EmployeeRepository; | 
 | ||||||
|  | import java.util.Arrays; | ||||||
|  | 
 | ||||||
| import org.junit.After; | import org.junit.After; | ||||||
| import org.junit.Before; | import org.junit.Before; | ||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| @ -12,10 +14,9 @@ import org.springframework.boot.test.context.SpringBootTest; | |||||||
| import org.springframework.test.context.junit4.SpringRunner; | import org.springframework.test.context.junit4.SpringRunner; | ||||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||||
| 
 | 
 | ||||||
| import java.util.Arrays; | import com.baeldung.elementcollection.model.Employee; | ||||||
| 
 | import com.baeldung.elementcollection.model.Phone; | ||||||
| import static org.hamcrest.core.Is.is; | import com.baeldung.elementcollection.repository.EmployeeRepository; | ||||||
| import static org.junit.Assert.assertThat; |  | ||||||
| 
 | 
 | ||||||
| @RunWith(SpringRunner.class) | @RunWith(SpringRunner.class) | ||||||
| @SpringBootTest(classes = ElementCollectionApplication.class) | @SpringBootTest(classes = ElementCollectionApplication.class) | ||||||
| @ -1,5 +1,17 @@ | |||||||
| package com.baeldung.namingstrategy; | package com.baeldung.namingstrategy; | ||||||
| 
 | 
 | ||||||
|  | import static org.assertj.core.api.Assertions.assertThat; | ||||||
|  | import static org.junit.jupiter.api.Assertions.assertThrows; | ||||||
|  | 
 | ||||||
|  | import java.math.BigInteger; | ||||||
|  | import java.util.Arrays; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.stream.Collectors; | ||||||
|  | 
 | ||||||
|  | import javax.persistence.EntityManager; | ||||||
|  | import javax.persistence.PersistenceContext; | ||||||
|  | import javax.persistence.Query; | ||||||
|  | 
 | ||||||
| import org.hibernate.exception.SQLGrammarException; | import org.hibernate.exception.SQLGrammarException; | ||||||
| import org.junit.jupiter.api.BeforeEach; | import org.junit.jupiter.api.BeforeEach; | ||||||
| import org.junit.jupiter.api.Test; | import org.junit.jupiter.api.Test; | ||||||
| @ -10,17 +22,6 @@ import org.springframework.boot.test.autoconfigure.jdbc.TestDatabaseAutoConfigur | |||||||
| import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||||||
| import org.springframework.test.context.TestPropertySource; | import org.springframework.test.context.TestPropertySource; | ||||||
| 
 | 
 | ||||||
| import javax.persistence.EntityManager; |  | ||||||
| import javax.persistence.PersistenceContext; |  | ||||||
| import javax.persistence.Query; |  | ||||||
| import java.math.BigInteger; |  | ||||||
| import java.util.Arrays; |  | ||||||
| import java.util.List; |  | ||||||
| import java.util.stream.Collectors; |  | ||||||
| 
 |  | ||||||
| import static org.assertj.core.api.Assertions.assertThat; |  | ||||||
| import static org.junit.jupiter.api.Assertions.assertThrows; |  | ||||||
| 
 |  | ||||||
| @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | ||||||
| @TestPropertySource("quoted-lower-case-naming-strategy.properties") | @TestPropertySource("quoted-lower-case-naming-strategy.properties") | ||||||
| class QuotedLowerCaseNamingStrategyH2IntegrationTest { | class QuotedLowerCaseNamingStrategyH2IntegrationTest { | ||||||
| @ -1,5 +1,17 @@ | |||||||
| package com.baeldung.namingstrategy; | package com.baeldung.namingstrategy; | ||||||
| 
 | 
 | ||||||
|  | import static org.assertj.core.api.Assertions.assertThat; | ||||||
|  | import static org.junit.jupiter.api.Assertions.assertThrows; | ||||||
|  | 
 | ||||||
|  | import java.math.BigInteger; | ||||||
|  | import java.util.Arrays; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.stream.Collectors; | ||||||
|  | 
 | ||||||
|  | import javax.persistence.EntityManager; | ||||||
|  | import javax.persistence.PersistenceContext; | ||||||
|  | import javax.persistence.Query; | ||||||
|  | 
 | ||||||
| import org.hibernate.exception.SQLGrammarException; | import org.hibernate.exception.SQLGrammarException; | ||||||
| import org.junit.jupiter.api.BeforeEach; | import org.junit.jupiter.api.BeforeEach; | ||||||
| import org.junit.jupiter.api.Test; | import org.junit.jupiter.api.Test; | ||||||
| @ -10,17 +22,6 @@ import org.springframework.boot.test.autoconfigure.jdbc.TestDatabaseAutoConfigur | |||||||
| import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||||||
| import org.springframework.test.context.TestPropertySource; | import org.springframework.test.context.TestPropertySource; | ||||||
| 
 | 
 | ||||||
| import javax.persistence.EntityManager; |  | ||||||
| import javax.persistence.PersistenceContext; |  | ||||||
| import javax.persistence.Query; |  | ||||||
| import java.math.BigInteger; |  | ||||||
| import java.util.Arrays; |  | ||||||
| import java.util.List; |  | ||||||
| import java.util.stream.Collectors; |  | ||||||
| 
 |  | ||||||
| import static org.assertj.core.api.Assertions.assertThat; |  | ||||||
| import static org.junit.jupiter.api.Assertions.assertThrows; |  | ||||||
| 
 |  | ||||||
| @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | ||||||
| @TestPropertySource("quoted-lower-case-naming-strategy-on-postgres.properties") | @TestPropertySource("quoted-lower-case-naming-strategy-on-postgres.properties") | ||||||
| class QuotedLowerCaseNamingStrategyPostgresLiveTest { | class QuotedLowerCaseNamingStrategyPostgresLiveTest { | ||||||
| @ -1,5 +1,17 @@ | |||||||
| package com.baeldung.namingstrategy; | package com.baeldung.namingstrategy; | ||||||
| 
 | 
 | ||||||
|  | import static org.assertj.core.api.Assertions.assertThat; | ||||||
|  | import static org.junit.jupiter.api.Assertions.assertThrows; | ||||||
|  | 
 | ||||||
|  | import java.math.BigInteger; | ||||||
|  | import java.util.Arrays; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.stream.Collectors; | ||||||
|  | 
 | ||||||
|  | import javax.persistence.EntityManager; | ||||||
|  | import javax.persistence.PersistenceContext; | ||||||
|  | import javax.persistence.Query; | ||||||
|  | 
 | ||||||
| import org.hibernate.exception.SQLGrammarException; | import org.hibernate.exception.SQLGrammarException; | ||||||
| import org.junit.jupiter.api.BeforeEach; | import org.junit.jupiter.api.BeforeEach; | ||||||
| import org.junit.jupiter.api.Test; | import org.junit.jupiter.api.Test; | ||||||
| @ -10,17 +22,6 @@ import org.springframework.boot.test.autoconfigure.jdbc.TestDatabaseAutoConfigur | |||||||
| import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||||||
| import org.springframework.test.context.TestPropertySource; | import org.springframework.test.context.TestPropertySource; | ||||||
| 
 | 
 | ||||||
| import javax.persistence.EntityManager; |  | ||||||
| import javax.persistence.PersistenceContext; |  | ||||||
| import javax.persistence.Query; |  | ||||||
| import java.math.BigInteger; |  | ||||||
| import java.util.Arrays; |  | ||||||
| import java.util.List; |  | ||||||
| import java.util.stream.Collectors; |  | ||||||
| 
 |  | ||||||
| import static org.assertj.core.api.Assertions.assertThat; |  | ||||||
| import static org.junit.jupiter.api.Assertions.assertThrows; |  | ||||||
| 
 |  | ||||||
| @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | ||||||
| @TestPropertySource("quoted-upper-case-naming-strategy.properties") | @TestPropertySource("quoted-upper-case-naming-strategy.properties") | ||||||
| class QuotedUpperCaseNamingStrategyH2IntegrationTest { | class QuotedUpperCaseNamingStrategyH2IntegrationTest { | ||||||
| @ -1,5 +1,17 @@ | |||||||
| package com.baeldung.namingstrategy; | package com.baeldung.namingstrategy; | ||||||
| 
 | 
 | ||||||
|  | import static org.assertj.core.api.Assertions.assertThat; | ||||||
|  | import static org.junit.jupiter.api.Assertions.assertThrows; | ||||||
|  | 
 | ||||||
|  | import java.math.BigInteger; | ||||||
|  | import java.util.Arrays; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.stream.Collectors; | ||||||
|  | 
 | ||||||
|  | import javax.persistence.EntityManager; | ||||||
|  | import javax.persistence.PersistenceContext; | ||||||
|  | import javax.persistence.Query; | ||||||
|  | 
 | ||||||
| import org.hibernate.exception.SQLGrammarException; | import org.hibernate.exception.SQLGrammarException; | ||||||
| import org.junit.jupiter.api.BeforeEach; | import org.junit.jupiter.api.BeforeEach; | ||||||
| import org.junit.jupiter.api.Test; | import org.junit.jupiter.api.Test; | ||||||
| @ -10,17 +22,6 @@ import org.springframework.boot.test.autoconfigure.jdbc.TestDatabaseAutoConfigur | |||||||
| import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||||||
| import org.springframework.test.context.TestPropertySource; | import org.springframework.test.context.TestPropertySource; | ||||||
| 
 | 
 | ||||||
| import javax.persistence.EntityManager; |  | ||||||
| import javax.persistence.PersistenceContext; |  | ||||||
| import javax.persistence.Query; |  | ||||||
| import java.math.BigInteger; |  | ||||||
| import java.util.Arrays; |  | ||||||
| import java.util.List; |  | ||||||
| import java.util.stream.Collectors; |  | ||||||
| 
 |  | ||||||
| import static org.assertj.core.api.Assertions.assertThat; |  | ||||||
| import static org.junit.jupiter.api.Assertions.assertThrows; |  | ||||||
| 
 |  | ||||||
| @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | ||||||
| @TestPropertySource("quoted-upper-case-naming-strategy-on-postgres.properties") | @TestPropertySource("quoted-upper-case-naming-strategy-on-postgres.properties") | ||||||
| class QuotedUpperCaseNamingStrategyPostgresLiveTest { | class QuotedUpperCaseNamingStrategyPostgresLiveTest { | ||||||
| @ -1,5 +1,17 @@ | |||||||
| package com.baeldung.namingstrategy; | package com.baeldung.namingstrategy; | ||||||
| 
 | 
 | ||||||
|  | import static org.assertj.core.api.Assertions.assertThat; | ||||||
|  | import static org.junit.jupiter.api.Assertions.assertThrows; | ||||||
|  | 
 | ||||||
|  | import java.math.BigInteger; | ||||||
|  | import java.util.Arrays; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.stream.Collectors; | ||||||
|  | 
 | ||||||
|  | import javax.persistence.EntityManager; | ||||||
|  | import javax.persistence.PersistenceContext; | ||||||
|  | import javax.persistence.Query; | ||||||
|  | 
 | ||||||
| import org.hibernate.exception.SQLGrammarException; | import org.hibernate.exception.SQLGrammarException; | ||||||
| import org.junit.jupiter.api.BeforeEach; | import org.junit.jupiter.api.BeforeEach; | ||||||
| import org.junit.jupiter.api.Test; | import org.junit.jupiter.api.Test; | ||||||
| @ -10,17 +22,6 @@ import org.springframework.boot.test.autoconfigure.jdbc.TestDatabaseAutoConfigur | |||||||
| import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||||||
| import org.springframework.test.context.TestPropertySource; | import org.springframework.test.context.TestPropertySource; | ||||||
| 
 | 
 | ||||||
| import javax.persistence.EntityManager; |  | ||||||
| import javax.persistence.PersistenceContext; |  | ||||||
| import javax.persistence.Query; |  | ||||||
| import java.math.BigInteger; |  | ||||||
| import java.util.Arrays; |  | ||||||
| import java.util.List; |  | ||||||
| import java.util.stream.Collectors; |  | ||||||
| 
 |  | ||||||
| import static org.assertj.core.api.Assertions.assertThat; |  | ||||||
| import static org.junit.jupiter.api.Assertions.assertThrows; |  | ||||||
| 
 |  | ||||||
| @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | ||||||
| @TestPropertySource("spring-physical-naming-strategy.properties") | @TestPropertySource("spring-physical-naming-strategy.properties") | ||||||
| class SpringPhysicalNamingStrategyH2IntegrationTest { | class SpringPhysicalNamingStrategyH2IntegrationTest { | ||||||
| @ -1,5 +1,17 @@ | |||||||
| package com.baeldung.namingstrategy; | package com.baeldung.namingstrategy; | ||||||
| 
 | 
 | ||||||
|  | import static org.assertj.core.api.Assertions.assertThat; | ||||||
|  | import static org.junit.jupiter.api.Assertions.assertThrows; | ||||||
|  | 
 | ||||||
|  | import java.math.BigInteger; | ||||||
|  | import java.util.Arrays; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.stream.Collectors; | ||||||
|  | 
 | ||||||
|  | import javax.persistence.EntityManager; | ||||||
|  | import javax.persistence.PersistenceContext; | ||||||
|  | import javax.persistence.Query; | ||||||
|  | 
 | ||||||
| import org.hibernate.exception.SQLGrammarException; | import org.hibernate.exception.SQLGrammarException; | ||||||
| import org.junit.jupiter.api.BeforeEach; | import org.junit.jupiter.api.BeforeEach; | ||||||
| import org.junit.jupiter.api.Test; | import org.junit.jupiter.api.Test; | ||||||
| @ -10,17 +22,6 @@ import org.springframework.boot.test.autoconfigure.jdbc.TestDatabaseAutoConfigur | |||||||
| import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||||||
| import org.springframework.test.context.TestPropertySource; | import org.springframework.test.context.TestPropertySource; | ||||||
| 
 | 
 | ||||||
| import javax.persistence.EntityManager; |  | ||||||
| import javax.persistence.PersistenceContext; |  | ||||||
| import javax.persistence.Query; |  | ||||||
| import java.math.BigInteger; |  | ||||||
| import java.util.Arrays; |  | ||||||
| import java.util.List; |  | ||||||
| import java.util.stream.Collectors; |  | ||||||
| 
 |  | ||||||
| import static org.assertj.core.api.Assertions.assertThat; |  | ||||||
| import static org.junit.jupiter.api.Assertions.assertThrows; |  | ||||||
| 
 |  | ||||||
| @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | ||||||
| @TestPropertySource("spring-physical-naming-strategy-on-postgres.properties") | @TestPropertySource("spring-physical-naming-strategy-on-postgres.properties") | ||||||
| class SpringPhysicalNamingStrategyPostgresLiveTest { | class SpringPhysicalNamingStrategyPostgresLiveTest { | ||||||
| @ -1,5 +1,17 @@ | |||||||
| package com.baeldung.namingstrategy; | package com.baeldung.namingstrategy; | ||||||
| 
 | 
 | ||||||
|  | import static org.assertj.core.api.Assertions.assertThat; | ||||||
|  | import static org.junit.jupiter.api.Assertions.assertThrows; | ||||||
|  | 
 | ||||||
|  | import java.math.BigInteger; | ||||||
|  | import java.util.Arrays; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.stream.Collectors; | ||||||
|  | 
 | ||||||
|  | import javax.persistence.EntityManager; | ||||||
|  | import javax.persistence.PersistenceContext; | ||||||
|  | import javax.persistence.Query; | ||||||
|  | 
 | ||||||
| import org.hibernate.exception.SQLGrammarException; | import org.hibernate.exception.SQLGrammarException; | ||||||
| import org.junit.jupiter.api.BeforeEach; | import org.junit.jupiter.api.BeforeEach; | ||||||
| import org.junit.jupiter.api.Test; | import org.junit.jupiter.api.Test; | ||||||
| @ -10,18 +22,6 @@ import org.springframework.boot.test.autoconfigure.jdbc.TestDatabaseAutoConfigur | |||||||
| import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||||||
| import org.springframework.test.context.TestPropertySource; | import org.springframework.test.context.TestPropertySource; | ||||||
| 
 | 
 | ||||||
| import javax.persistence.EntityManager; |  | ||||||
| import javax.persistence.PersistenceContext; |  | ||||||
| import javax.persistence.Query; |  | ||||||
| import java.math.BigInteger; |  | ||||||
| import java.sql.SQLException; |  | ||||||
| import java.util.Arrays; |  | ||||||
| import java.util.List; |  | ||||||
| import java.util.stream.Collectors; |  | ||||||
| 
 |  | ||||||
| import static org.assertj.core.api.Assertions.assertThat; |  | ||||||
| import static org.junit.jupiter.api.Assertions.assertThrows; |  | ||||||
| 
 |  | ||||||
| @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | ||||||
| @TestPropertySource("unquoted-lower-case-naming-strategy.properties") | @TestPropertySource("unquoted-lower-case-naming-strategy.properties") | ||||||
| class UnquotedLowerCaseNamingStrategyH2IntegrationTest { | class UnquotedLowerCaseNamingStrategyH2IntegrationTest { | ||||||
| @ -1,5 +1,17 @@ | |||||||
| package com.baeldung.namingstrategy; | package com.baeldung.namingstrategy; | ||||||
| 
 | 
 | ||||||
|  | import static org.assertj.core.api.Assertions.assertThat; | ||||||
|  | import static org.junit.jupiter.api.Assertions.assertThrows; | ||||||
|  | 
 | ||||||
|  | import java.math.BigInteger; | ||||||
|  | import java.util.Arrays; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.stream.Collectors; | ||||||
|  | 
 | ||||||
|  | import javax.persistence.EntityManager; | ||||||
|  | import javax.persistence.PersistenceContext; | ||||||
|  | import javax.persistence.Query; | ||||||
|  | 
 | ||||||
| import org.hibernate.exception.SQLGrammarException; | import org.hibernate.exception.SQLGrammarException; | ||||||
| import org.junit.jupiter.api.BeforeEach; | import org.junit.jupiter.api.BeforeEach; | ||||||
| import org.junit.jupiter.api.Test; | import org.junit.jupiter.api.Test; | ||||||
| @ -10,17 +22,6 @@ import org.springframework.boot.test.autoconfigure.jdbc.TestDatabaseAutoConfigur | |||||||
| import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||||||
| import org.springframework.test.context.TestPropertySource; | import org.springframework.test.context.TestPropertySource; | ||||||
| 
 | 
 | ||||||
| import javax.persistence.EntityManager; |  | ||||||
| import javax.persistence.PersistenceContext; |  | ||||||
| import javax.persistence.Query; |  | ||||||
| import java.math.BigInteger; |  | ||||||
| import java.util.Arrays; |  | ||||||
| import java.util.List; |  | ||||||
| import java.util.stream.Collectors; |  | ||||||
| 
 |  | ||||||
| import static org.assertj.core.api.Assertions.assertThat; |  | ||||||
| import static org.junit.jupiter.api.Assertions.assertThrows; |  | ||||||
| 
 |  | ||||||
| @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | ||||||
| @TestPropertySource("unquoted-lower-case-naming-strategy-on-postgres.properties") | @TestPropertySource("unquoted-lower-case-naming-strategy-on-postgres.properties") | ||||||
| class UnquotedLowerCaseNamingStrategyPostgresLiveTest { | class UnquotedLowerCaseNamingStrategyPostgresLiveTest { | ||||||
| @ -1,5 +1,17 @@ | |||||||
| package com.baeldung.namingstrategy; | package com.baeldung.namingstrategy; | ||||||
| 
 | 
 | ||||||
|  | import static org.assertj.core.api.Assertions.assertThat; | ||||||
|  | import static org.junit.jupiter.api.Assertions.assertThrows; | ||||||
|  | 
 | ||||||
|  | import java.math.BigInteger; | ||||||
|  | import java.util.Arrays; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.stream.Collectors; | ||||||
|  | 
 | ||||||
|  | import javax.persistence.EntityManager; | ||||||
|  | import javax.persistence.PersistenceContext; | ||||||
|  | import javax.persistence.Query; | ||||||
|  | 
 | ||||||
| import org.hibernate.exception.SQLGrammarException; | import org.hibernate.exception.SQLGrammarException; | ||||||
| import org.junit.jupiter.api.BeforeEach; | import org.junit.jupiter.api.BeforeEach; | ||||||
| import org.junit.jupiter.api.Test; | import org.junit.jupiter.api.Test; | ||||||
| @ -10,17 +22,6 @@ import org.springframework.boot.test.autoconfigure.jdbc.TestDatabaseAutoConfigur | |||||||
| import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||||||
| import org.springframework.test.context.TestPropertySource; | import org.springframework.test.context.TestPropertySource; | ||||||
| 
 | 
 | ||||||
| import javax.persistence.EntityManager; |  | ||||||
| import javax.persistence.PersistenceContext; |  | ||||||
| import javax.persistence.Query; |  | ||||||
| import java.math.BigInteger; |  | ||||||
| import java.util.Arrays; |  | ||||||
| import java.util.List; |  | ||||||
| import java.util.stream.Collectors; |  | ||||||
| 
 |  | ||||||
| import static org.assertj.core.api.Assertions.assertThat; |  | ||||||
| import static org.junit.jupiter.api.Assertions.assertThrows; |  | ||||||
| 
 |  | ||||||
| @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | ||||||
| @TestPropertySource("unquoted-upper-case-naming-strategy.properties") | @TestPropertySource("unquoted-upper-case-naming-strategy.properties") | ||||||
| class UnquotedUpperCaseNamingStrategyH2IntegrationTest { | class UnquotedUpperCaseNamingStrategyH2IntegrationTest { | ||||||
| @ -1,5 +1,17 @@ | |||||||
| package com.baeldung.namingstrategy; | package com.baeldung.namingstrategy; | ||||||
| 
 | 
 | ||||||
|  | import static org.assertj.core.api.Assertions.assertThat; | ||||||
|  | import static org.junit.jupiter.api.Assertions.assertThrows; | ||||||
|  | 
 | ||||||
|  | import java.math.BigInteger; | ||||||
|  | import java.util.Arrays; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.stream.Collectors; | ||||||
|  | 
 | ||||||
|  | import javax.persistence.EntityManager; | ||||||
|  | import javax.persistence.PersistenceContext; | ||||||
|  | import javax.persistence.Query; | ||||||
|  | 
 | ||||||
| import org.hibernate.exception.SQLGrammarException; | import org.hibernate.exception.SQLGrammarException; | ||||||
| import org.junit.jupiter.api.BeforeEach; | import org.junit.jupiter.api.BeforeEach; | ||||||
| import org.junit.jupiter.api.Test; | import org.junit.jupiter.api.Test; | ||||||
| @ -10,17 +22,6 @@ import org.springframework.boot.test.autoconfigure.jdbc.TestDatabaseAutoConfigur | |||||||
| import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||||||
| import org.springframework.test.context.TestPropertySource; | import org.springframework.test.context.TestPropertySource; | ||||||
| 
 | 
 | ||||||
| import javax.persistence.EntityManager; |  | ||||||
| import javax.persistence.PersistenceContext; |  | ||||||
| import javax.persistence.Query; |  | ||||||
| import java.math.BigInteger; |  | ||||||
| import java.util.Arrays; |  | ||||||
| import java.util.List; |  | ||||||
| import java.util.stream.Collectors; |  | ||||||
| 
 |  | ||||||
| import static org.assertj.core.api.Assertions.assertThat; |  | ||||||
| import static org.junit.jupiter.api.Assertions.assertThrows; |  | ||||||
| 
 |  | ||||||
| @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | @DataJpaTest(excludeAutoConfiguration = TestDatabaseAutoConfiguration.class) | ||||||
| @TestPropertySource("unquoted-upper-case-naming-strategy-on-postgres.properties") | @TestPropertySource("unquoted-upper-case-naming-strategy-on-postgres.properties") | ||||||
| class UnquotedUpperCaseNamingStrategyPostgresLiveTest { | class UnquotedUpperCaseNamingStrategyPostgresLiveTest { | ||||||
| @ -7,8 +7,6 @@ This module contains articles about Spring Data JPA used in enterprise applicati | |||||||
| - [Spring Data Java 8 Support](https://www.baeldung.com/spring-data-java-8) | - [Spring Data Java 8 Support](https://www.baeldung.com/spring-data-java-8) | ||||||
| - [DB Integration Tests with Spring Boot and Testcontainers](https://www.baeldung.com/spring-boot-testcontainers-integration-test) | - [DB Integration Tests with Spring Boot and Testcontainers](https://www.baeldung.com/spring-boot-testcontainers-integration-test) | ||||||
| - [A Guide to Spring’s Open Session in View](https://www.baeldung.com/spring-open-session-in-view) | - [A Guide to Spring’s Open Session in View](https://www.baeldung.com/spring-open-session-in-view) | ||||||
| - [Working with Lazy Element Collections in JPA](https://www.baeldung.com/java-jpa-lazy-collections) |  | ||||||
| - [Custom Naming Convention with Spring Data JPA](https://www.baeldung.com/spring-data-jpa-custom-naming) |  | ||||||
| - [Partial Data Update With Spring Data](https://www.baeldung.com/spring-data-partial-update) | - [Partial Data Update With Spring Data](https://www.baeldung.com/spring-data-partial-update) | ||||||
| - [Spring Data JPA @Modifying Annotation](https://www.baeldung.com/spring-data-jpa-modifying-annotation) | - [Spring Data JPA @Modifying Annotation](https://www.baeldung.com/spring-data-jpa-modifying-annotation) | ||||||
| - [Spring JPA – Multiple Databases](https://www.baeldung.com/spring-data-jpa-multiple-databases) | - [Spring JPA – Multiple Databases](https://www.baeldung.com/spring-data-jpa-multiple-databases) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user