Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
bc1ee76b
Commit
bc1ee76b
authored
Apr 24, 2017
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change default for new_generator_mappings to true
Closes gh-7612
parent
1ad318d8
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
22 additions
and
6 deletions
+22
-6
JpaProperties.java
...ngframework/boot/autoconfigure/orm/jpa/JpaProperties.java
+1
-1
JpaPropertiesTests.java
...mework/boot/autoconfigure/orm/jpa/JpaPropertiesTests.java
+4
-4
SampleDataJpaApplicationTests.java
...t/java/sample/data/jpa/SampleDataJpaApplicationTests.java
+1
-1
CityRepositoryIntegrationTests.java
...mple/data/jpa/service/CityRepositoryIntegrationTests.java
+2
-0
HotelRepositoryIntegrationTests.java
...ple/data/jpa/service/HotelRepositoryIntegrationTests.java
+2
-0
SampleDataRestApplicationTests.java
...java/sample/data/rest/SampleDataRestApplicationTests.java
+2
-0
CityRepositoryIntegrationTests.java
...ple/data/rest/service/CityRepositoryIntegrationTests.java
+2
-0
SampleFlywayApplicationTests.java
...test/java/sample/flyway/SampleFlywayApplicationTests.java
+2
-0
SampleJpaApplicationTests.java
...a/src/test/java/sample/jpa/SampleJpaApplicationTests.java
+2
-0
JpaNoteRepositoryIntegrationTests.java
...ple/jpa/repository/JpaNoteRepositoryIntegrationTests.java
+2
-0
JpaTagRepositoryIntegrationTests.java
...mple/jpa/repository/JpaTagRepositoryIntegrationTests.java
+2
-0
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java
View file @
bc1ee76b
...
...
@@ -202,7 +202,7 @@ public class JpaProperties {
this
.
useNewIdGeneratorMappings
.
toString
());
}
else
if
(!
result
.
containsKey
(
USE_NEW_ID_GENERATOR_MAPPINGS
))
{
result
.
put
(
USE_NEW_ID_GENERATOR_MAPPINGS
,
"
fals
e"
);
result
.
put
(
USE_NEW_ID_GENERATOR_MAPPINGS
,
"
tru
e"
);
}
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/JpaPropertiesTests.java
View file @
bc1ee76b
...
...
@@ -108,17 +108,17 @@ public class JpaPropertiesTests {
Map
<
String
,
String
>
hibernateProperties
=
properties
.
getHibernateProperties
(
mockStandaloneDataSource
());
assertThat
(
hibernateProperties
)
.
containsEntry
(
AvailableSettings
.
USE_NEW_ID_GENERATOR_MAPPINGS
,
"
fals
e"
);
.
containsEntry
(
AvailableSettings
.
USE_NEW_ID_GENERATOR_MAPPINGS
,
"
tru
e"
);
}
@Test
public
void
useNewIdGeneratorMappings
Tru
e
()
throws
Exception
{
public
void
useNewIdGeneratorMappings
Fals
e
()
throws
Exception
{
JpaProperties
properties
=
load
(
"spring.jpa.hibernate.use-new-id-generator-mappings:
tru
e"
);
"spring.jpa.hibernate.use-new-id-generator-mappings:
fals
e"
);
Map
<
String
,
String
>
hibernateProperties
=
properties
.
getHibernateProperties
(
mockStandaloneDataSource
());
assertThat
(
hibernateProperties
)
.
containsEntry
(
AvailableSettings
.
USE_NEW_ID_GENERATOR_MAPPINGS
,
"
tru
e"
);
.
containsEntry
(
AvailableSettings
.
USE_NEW_ID_GENERATOR_MAPPINGS
,
"
fals
e"
);
}
@Test
...
...
spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/SampleDataJpaApplicationTests.java
View file @
bc1ee76b
...
...
@@ -48,7 +48,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@SpringBootTest
// Enable JMX so we can test the MBeans (you can't do this in a properties file)
@TestPropertySource
(
properties
=
{
"spring.jmx.enabled:true"
,
"spring.datasource.jmx-enabled:true"
})
"spring.datasource.jmx-enabled:true"
,
"spring.jpa.hibernate.use-new-id-generator-mappings=false"
})
@ActiveProfiles
(
"scratch"
)
// Separate profile for web tests to avoid clashing databases
public
class
SampleDataJpaApplicationTests
{
...
...
spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/CityRepositoryIntegrationTests.java
View file @
bc1ee76b
...
...
@@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -34,6 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@TestPropertySource
(
properties
=
"spring.jpa.hibernate.use-new-id-generator-mappings=false"
)
public
class
CityRepositoryIntegrationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/HotelRepositoryIntegrationTests.java
View file @
bc1ee76b
...
...
@@ -30,6 +30,7 @@ import org.springframework.boot.test.context.SpringBootTest;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Sort.Direction
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -41,6 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@TestPropertySource
(
properties
=
"spring.jpa.hibernate.use-new-id-generator-mappings=false"
)
public
class
HotelRepositoryIntegrationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/SampleDataRestApplicationTests.java
View file @
bc1ee76b
...
...
@@ -23,6 +23,7 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.ActiveProfiles
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.setup.MockMvcBuilders
;
...
...
@@ -44,6 +45,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@TestPropertySource
(
properties
=
"spring.jpa.hibernate.use-new-id-generator-mappings=false"
)
@ActiveProfiles
(
"scratch"
)
// Separate profile for web tests to avoid clashing databases
public
class
SampleDataRestApplicationTests
{
...
...
spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/service/CityRepositoryIntegrationTests.java
View file @
bc1ee76b
...
...
@@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -36,6 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@TestPropertySource
(
properties
=
"spring.jpa.hibernate.use-new-id-generator-mappings=false"
)
public
class
CityRepositoryIntegrationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-flyway/src/test/java/sample/flyway/SampleFlywayApplicationTests.java
View file @
bc1ee76b
...
...
@@ -22,12 +22,14 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@TestPropertySource
(
properties
=
"spring.jpa.hibernate.use-new-id-generator-mappings=false"
)
public
class
SampleFlywayApplicationTests
{
@Autowired
...
...
spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/SampleJpaApplicationTests.java
View file @
bc1ee76b
...
...
@@ -22,6 +22,7 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.web.WebAppConfiguration
;
import
org.springframework.test.web.servlet.MockMvc
;
...
...
@@ -40,6 +41,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@TestPropertySource
(
properties
=
"spring.jpa.hibernate.use-new-id-generator-mappings=false"
)
@WebAppConfiguration
public
class
SampleJpaApplicationTests
{
...
...
spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/repository/JpaNoteRepositoryIntegrationTests.java
View file @
bc1ee76b
...
...
@@ -23,6 +23,7 @@ import sample.jpa.domain.Note;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -35,6 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@TestPropertySource
(
properties
=
"spring.jpa.hibernate.use-new-id-generator-mappings=false"
)
@Transactional
public
class
JpaNoteRepositoryIntegrationTests
{
...
...
spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/repository/JpaTagRepositoryIntegrationTests.java
View file @
bc1ee76b
...
...
@@ -23,6 +23,7 @@ import sample.jpa.domain.Tag;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -35,6 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@TestPropertySource
(
properties
=
"spring.jpa.hibernate.use-new-id-generator-mappings=false"
)
@Transactional
public
class
JpaTagRepositoryIntegrationTests
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment