From dc7b3f6d6ecc554b2872ad41f4393c966dfb5ba5 Mon Sep 17 00:00:00 2001 From: Madhura Bhave Date: Thu, 27 Apr 2017 18:53:05 -0700 Subject: [PATCH] Update samples to use new generator mappings Closes gh-7612 --- .../java/sample/data/jpa/domain/City.java | 4 +- .../java/sample/data/jpa/domain/Hotel.java | 4 +- .../java/sample/data/jpa/domain/Review.java | 4 +- .../src/main/resources/import.sql | 222 +++++++++--------- .../jpa/SampleDataJpaApplicationTests.java | 3 +- .../CityRepositoryIntegrationTests.java | 2 - .../HotelRepositoryIntegrationTests.java | 2 - .../java/sample/data/rest/domain/City.java | 4 +- .../java/sample/data/rest/domain/Hotel.java | 4 +- .../src/main/resources/import.sql | 94 ++++---- .../rest/SampleDataRestApplicationTests.java | 4 - .../CityRepositoryIntegrationTests.java | 2 - .../src/main/java/sample/flyway/Person.java | 4 +- .../main/resources/db/migration/V1__init.sql | 2 + .../flyway/SampleFlywayApplicationTests.java | 2 - .../src/main/java/sample/jpa/domain/Note.java | 5 +- .../src/main/java/sample/jpa/domain/Tag.java | 4 +- .../src/main/resources/import.sql | 14 +- .../sample/jpa/SampleJpaApplicationTests.java | 2 - .../JpaNoteRepositoryIntegrationTests.java | 2 - .../JpaTagRepositoryIntegrationTests.java | 2 - 21 files changed, 191 insertions(+), 195 deletions(-) diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/City.java b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/City.java index 55ebea85823f..130b22ef6dd5 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/City.java +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/City.java @@ -22,6 +22,7 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.SequenceGenerator; @Entity public class City implements Serializable { @@ -29,7 +30,8 @@ public class City implements Serializable { private static final long serialVersionUID = 1L; @Id - @GeneratedValue + @SequenceGenerator(name="city_generator", sequenceName="city_sequence", initialValue = 23) + @GeneratedValue(generator = "city_generator") private Long id; @Column(nullable = false) diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Hotel.java b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Hotel.java index f3cb6ab8bb5f..ce7e86592e29 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Hotel.java +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Hotel.java @@ -26,6 +26,7 @@ import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; import org.hibernate.annotations.NaturalId; @@ -35,7 +36,8 @@ public class Hotel implements Serializable { private static final long serialVersionUID = 1L; @Id - @GeneratedValue + @SequenceGenerator(name="hotel_generator", sequenceName="hotel_sequence", initialValue = 28) + @GeneratedValue(generator = "hotel_generator") private Long id; @ManyToOne(optional = false) diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Review.java b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Review.java index db2e2ab606c2..ec6734e4adb4 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Review.java +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Review.java @@ -26,6 +26,7 @@ import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; import javax.persistence.Temporal; import javax.persistence.TemporalType; @@ -37,7 +38,8 @@ public class Review implements Serializable { private static final long serialVersionUID = 1L; @Id - @GeneratedValue + @SequenceGenerator(name="review_generator", sequenceName="review_sequence", initialValue = 64) + @GeneratedValue(generator = "review_generator") private Long id; @ManyToOne(optional = false) diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/resources/import.sql b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/resources/import.sql index fbd484608b2a..8e21b3809942 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/resources/import.sql +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/resources/import.sql @@ -6,181 +6,181 @@ -- AUSTRALIA -- Brisbane -insert into city(country, name, state, map) values ('Australia', 'Brisbane', 'Queensland', '-27.470933, 153.023502') -insert into hotel(city_id, name, address, zip) values (1, 'Conrad Treasury Place', 'William & George Streets', '4001') +insert into city(id, country, name, state, map) values (1, 'Australia', 'Brisbane', 'Queensland', '-27.470933, 153.023502') +insert into hotel(id, city_id, name, address, zip) values (1, 1, 'Conrad Treasury Place', 'William & George Streets', '4001') -- Melbourne -insert into city(country, name, state, map) values ('Australia', 'Melbourne', 'Victoria', '-37.813187, 144.96298') -insert into hotel(city_id, name, address, zip) values (2, 'The Langham', '1 Southgate Ave, Southbank', '3006') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (2, 0, '2005-05-10', 2, 4, 'Pretty average', 'I stayed in 2005, the hotel was nice enough but nothing special.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (2, 1, '2006-01-12', 4, 2, 'Bright hotel with big rooms', 'This hotel has a fantastic lovely big windows. The room we stayed in had lots of space. Recommended.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (2, 2, '2006-05-25', 3, 1, 'Pretty good', 'I liked this hotel and would stay again.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (2, 3, '2009-01-20', 3, 2, 'Nice clean rooms', 'The rooms are maintained to a high standard and very clean, the bathroom was spotless!!') +insert into city(id, country, name, state, map) values (2, 'Australia', 'Melbourne', 'Victoria', '-37.813187, 144.96298') +insert into hotel(id, city_id, name, address, zip) values (2, 2, 'The Langham', '1 Southgate Ave, Southbank', '3006') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (1, 2, 0, '2005-05-10', 2, 4, 'Pretty average', 'I stayed in 2005, the hotel was nice enough but nothing special.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (2, 2, 1, '2006-01-12', 4, 2, 'Bright hotel with big rooms', 'This hotel has a fantastic lovely big windows. The room we stayed in had lots of space. Recommended.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (3, 2, 2, '2006-05-25', 3, 1, 'Pretty good', 'I liked this hotel and would stay again.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (4, 2, 3, '2009-01-20', 3, 2, 'Nice clean rooms', 'The rooms are maintained to a high standard and very clean, the bathroom was spotless!!') -- Sydney -insert into city(country, name, state, map) values ('Australia', 'Sydney', 'New South Wales', '-33.868901, 151.207091') -insert into hotel(city_id, name, address, zip) values (3, 'Swissotel', '68 Market Street', '2000') +insert into city(id, country, name, state, map) values (3, 'Australia', 'Sydney', 'New South Wales', '-33.868901, 151.207091') +insert into hotel(id, city_id, name, address, zip) values (3, 3, 'Swissotel', '68 Market Street', '2000') -- ================================================================================================= -- CANADA -- Montreal -insert into city(country, name, state, map) values ('Canada', 'Montreal', 'Quebec', '45.508889, -73.554167') -insert into hotel(city_id, name, address, zip) values (4, 'Ritz Carlton', '1228 Sherbrooke St', 'H3G1H6') +insert into city(id, country, name, state, map) values (4, 'Canada', 'Montreal', 'Quebec', '45.508889, -73.554167') +insert into hotel(id, city_id, name, address, zip) values (4, 4, 'Ritz Carlton', '1228 Sherbrooke St', 'H3G1H6') -- ================================================================================================= -- ISRAEL -- Tel Aviv -insert into city(country, name, state, map) values ('Israel', 'Tel Aviv', '', '32.066157, 34.777821') -insert into hotel(city_id, name, address, zip) values (5, 'Hilton Tel Aviv', 'Independence Park', '63405') +insert into city(id, country, name, state, map) values (5, 'Israel', 'Tel Aviv', '', '32.066157, 34.777821') +insert into hotel(id, city_id, name, address, zip) values (5, 5, 'Hilton Tel Aviv', 'Independence Park', '63405') -- ================================================================================================= -- JAPAN -- Tokyo -insert into city(country, name, state, map) values ('Japan', 'Tokyo', '', '35.689488, 139.691706') -insert into hotel(city_id, name, address, zip) values (6, 'InterContinental Tokyo Bay', 'Takeshiba Pier', '105') +insert into city(id, country, name, state, map) values (6, 'Japan', 'Tokyo', '', '35.689488, 139.691706') +insert into hotel(id, city_id, name, address, zip) values (6, 6, 'InterContinental Tokyo Bay', 'Takeshiba Pier', '105') -- ================================================================================================= -- SPAIN -- Barcelona -insert into city(country, name, state, map) values ('Spain', 'Barcelona', 'Catalunya', '41.387917, 2.169919') -insert into hotel(city_id, name, address, zip) values (7, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', '08019') +insert into city(id, country, name, state, map) values (7, 'Spain', 'Barcelona', 'Catalunya', '41.387917, 2.169919') +insert into hotel(id, city_id, name, address, zip) values (7, 7, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', '08019') -- ================================================================================================= -- SWITZERLAND -- Neuchatel -insert into city(country, name, state, map) values ('Switzerland', 'Neuchatel', '', '46.992979, 6.931933') -insert into hotel(city_id, name, address, zip) values (8, 'Hotel Beaulac', ' Esplanade Leopold-Robert 2', '2000') +insert into city(id, country, name, state, map) values (8, 'Switzerland', 'Neuchatel', '', '46.992979, 6.931933') +insert into hotel(id, city_id, name, address, zip) values (8, 8, 'Hotel Beaulac', ' Esplanade Leopold-Robert 2', '2000') -- ================================================================================================= -- UNITED KINGDOM -- Bath -insert into city(country, name, state, map) values ('UK', 'Bath', 'Somerset', '51.381428, -2.357454') -insert into hotel(city_id, name, address, zip) values (9, 'The Bath Priory Hotel', 'Weston Road', 'BA1 2XT') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 0, '2000-01-23', 4, 1, 'A lovely hotel', 'We stayed here after a wedding and it was fantastic. Recommend to all.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 1, '2000-08-04', 3, 1, 'Very special', 'A very special hotel with lovely staff.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 2, '2001-01-01', 2, 4, 'Nice but too hot', 'Stayed during the summer heat wave (exceptional for England!) and the room was very hot. Still recommended.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 3, '2002-01-20', 3, 1, 'Big rooms and a great view', 'Considering how central this hotel is the rooms are a very good size.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 4, '2002-11-03', 2, 1, 'Good but pricey', 'A nice hotel but be prepared to pay over the odds for your stay.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 5, '2003-09-18', 4, 1, 'Fantastic place', 'Just lovely.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 6, '2004-03-21', 4, 3, 'A very special place', 'I stayed here in 2004 and found it to be very relaxing, a nice pool and good gym is cherry on the cake.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 7, '2004-04-10', 0, 0, 'Terrible', 'I complained after I was told I could not check out after 11pm. Ridiculous!!!') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 8, '2004-12-20', 4, 4, 'A perfect location', 'Central location makes this a perfect hotel. Be warned though, it''s not cheap.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 9, '2005-04-19', 3, 2, 'Expensive but worth it', 'Dig deep into your pockets and enjoy this lovely City and fantastic hotel.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 10, '2005-05-21', 4, 1, 'The best hotel in the area', 'Top hotel in the area, would not stay anywhere else.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 11, '2005-11-17', 4, 2, 'Lovely hotel, fantastic grounds', 'The garden upkeep run into thousands (perhaps explaining why the rooms are so much) but so lovely and relaxing.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 12, '2006-01-04', 3, 4, 'Gorgeous Top Quality Hotel', 'Top draw stuff.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 13, '2006-01-21', 4, 1, 'Fabulous Hotel and Restaurant', 'The food at this hotel is second to none, try the peppered steak!') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 14, '2006-01-29', 4, 4, 'Feels like home', 'A lovely home away from home.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 15, '2006-03-21', 1, 1, 'Far too expensive', 'Overpriced, Overpriced, Overpriced!!') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 16, '2006-05-10', 4, 1, 'Excellent Hotel, Wonderful Staff', 'The staff went out of their way to help us after we missed our last train home, organising a Taxi back to Newport even after we had checked out.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 17, '2007-09-11', 3, 2, 'The perfect retreat', 'If you want a relaxing stay, this is the place.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 18, '2008-06-01', 3, 3, 'Lovely stay, fantastic staff', 'As other reviews have noted, the staff in this hotel really are the best in Bath.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 19, '2009-05-14', 4, 2, 'Can''t Wait to go back', 'We will stay again for sure.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 20, '2010-04-26', 4, 1, 'Amazing Hotel', 'We won a trip here after entering a competition. Not sure we would pay the full price but such a wonderful place.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 21, '2010-10-26', 2, 2, 'Dissapointed', 'The pool was closed, the chief was ill, the staff were rude my wallet is bruised!') -insert into hotel(city_id, name, address, zip) values (9, 'Bath Travelodge', 'Rossiter Road, Widcombe Basin', 'BA2 4JP') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 0, '2002-08-21', 0, 2, 'Terrible hotel', 'One of the worst hotels that I have ever stayed in.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 1, '2003-01-28', 0, 0, 'Rude and unpleasant staff', 'The staff refused to help me with any aspect of my stay, I will not stay here again.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 2, '2004-06-17', 1, 0, 'Below par', 'Don''t stay here!!') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 3, '2005-07-12', 0, 1, 'Small and Unpleasant', 'The room was far too small and felt unclean. Not recommended.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 4, '2006-01-07', 1, 4, 'Cheap if you are not fussy', 'This hotel has some rough edges but I challenge you to find somewhere cheaper.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 5, '2006-01-13', 0, 2, 'Terrible', 'Just terrible!') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 6, '2006-03-25', 0, 0, 'Smelly and dirty room', 'My room smelt of damp and I found the socks of the previous occupant under my bed.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 7, '2006-04-09', 0, 4, 'Grim', 'Grim. I would try elsewhere before staying here.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 8, '2006-08-01', 1, 3, 'Very Noisy', 'Building work during the day and a disco at night. Good grief!') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 9, '2009-01-03', 1, 4, 'Tired and falling down', 'This hotel is in serious need of refurbishment, the windows are rotting, the paintwork is tired and the carpets are from the 1970s.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 10, '2009-07-20', 0, 0, 'Not suitable for human habitation', 'I would not put my dog up in this hotel.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 11, '2010-05-20', 1, 0, 'Conveient for the railway', 'Average place but useful if you need to commute') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 12, '2010-01-22', 2, 2, 'Not as bad as the reviews', 'Some of the reviews seem a bit harsh, it''s not too bad for the price.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 13, '2011-01-10', 3, 1, 'Reburished and nice', 'Looks like this hotel has had a major facelift. If you have stayed before 2011 perhaps it''s time to give this hotel another try. Very good value for money and pretty nice.') +insert into city(id, country, name, state, map) values (9, 'UK', 'Bath', 'Somerset', '51.381428, -2.357454') +insert into hotel(id, city_id, name, address, zip) values (9, 9, 'The Bath Priory Hotel', 'Weston Road', 'BA1 2XT') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (5, 9, 0, '2000-01-23', 4, 1, 'A lovely hotel', 'We stayed here after a wedding and it was fantastic. Recommend to all.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (6, 9, 1, '2000-08-04', 3, 1, 'Very special', 'A very special hotel with lovely staff.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (7, 9, 2, '2001-01-01', 2, 4, 'Nice but too hot', 'Stayed during the summer heat wave (exceptional for England!) and the room was very hot. Still recommended.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (8, 9, 3, '2002-01-20', 3, 1, 'Big rooms and a great view', 'Considering how central this hotel is the rooms are a very good size.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (9, 9, 4, '2002-11-03', 2, 1, 'Good but pricey', 'A nice hotel but be prepared to pay over the odds for your stay.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (10, 9, 5, '2003-09-18', 4, 1, 'Fantastic place', 'Just lovely.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (11, 9, 6, '2004-03-21', 4, 3, 'A very special place', 'I stayed here in 2004 and found it to be very relaxing, a nice pool and good gym is cherry on the cake.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (12, 9, 7, '2004-04-10', 0, 0, 'Terrible', 'I complained after I was told I could not check out after 11pm. Ridiculous!!!') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (13, 9, 8, '2004-12-20', 4, 4, 'A perfect location', 'Central location makes this a perfect hotel. Be warned though, it''s not cheap.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (14, 9, 9, '2005-04-19', 3, 2, 'Expensive but worth it', 'Dig deep into your pockets and enjoy this lovely City and fantastic hotel.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (15, 9, 10, '2005-05-21', 4, 1, 'The best hotel in the area', 'Top hotel in the area, would not stay anywhere else.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (16, 9, 11, '2005-11-17', 4, 2, 'Lovely hotel, fantastic grounds', 'The garden upkeep run into thousands (perhaps explaining why the rooms are so much) but so lovely and relaxing.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (17, 9, 12, '2006-01-04', 3, 4, 'Gorgeous Top Quality Hotel', 'Top draw stuff.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (18, 9, 13, '2006-01-21', 4, 1, 'Fabulous Hotel and Restaurant', 'The food at this hotel is second to none, try the peppered steak!') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (19, 9, 14, '2006-01-29', 4, 4, 'Feels like home', 'A lovely home away from home.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (20, 9, 15, '2006-03-21', 1, 1, 'Far too expensive', 'Overpriced, Overpriced, Overpriced!!') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (21, 9, 16, '2006-05-10', 4, 1, 'Excellent Hotel, Wonderful Staff', 'The staff went out of their way to help us after we missed our last train home, organising a Taxi back to Newport even after we had checked out.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (22, 9, 17, '2007-09-11', 3, 2, 'The perfect retreat', 'If you want a relaxing stay, this is the place.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (23, 9, 18, '2008-06-01', 3, 3, 'Lovely stay, fantastic staff', 'As other reviews have noted, the staff in this hotel really are the best in Bath.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (24, 9, 19, '2009-05-14', 4, 2, 'Can''t Wait to go back', 'We will stay again for sure.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (25, 9, 20, '2010-04-26', 4, 1, 'Amazing Hotel', 'We won a trip here after entering a competition. Not sure we would pay the full price but such a wonderful place.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (26, 9, 21, '2010-10-26', 2, 2, 'Dissapointed', 'The pool was closed, the chief was ill, the staff were rude my wallet is bruised!') +insert into hotel(id, city_id, name, address, zip) values (10, 9, 'Bath Travelodge', 'Rossiter Road, Widcombe Basin', 'BA2 4JP') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (27, 10, 0, '2002-08-21', 0, 2, 'Terrible hotel', 'One of the worst hotels that I have ever stayed in.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (28, 10, 1, '2003-01-28', 0, 0, 'Rude and unpleasant staff', 'The staff refused to help me with any aspect of my stay, I will not stay here again.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (29, 10, 2, '2004-06-17', 1, 0, 'Below par', 'Don''t stay here!!') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (30, 10, 3, '2005-07-12', 0, 1, 'Small and Unpleasant', 'The room was far too small and felt unclean. Not recommended.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (31, 10, 4, '2006-01-07', 1, 4, 'Cheap if you are not fussy', 'This hotel has some rough edges but I challenge you to find somewhere cheaper.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (32, 10, 5, '2006-01-13', 0, 2, 'Terrible', 'Just terrible!') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (33, 10, 6, '2006-03-25', 0, 0, 'Smelly and dirty room', 'My room smelt of damp and I found the socks of the previous occupant under my bed.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (34, 10, 7, '2006-04-09', 0, 4, 'Grim', 'Grim. I would try elsewhere before staying here.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (35, 10, 8, '2006-08-01', 1, 3, 'Very Noisy', 'Building work during the day and a disco at night. Good grief!') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (36, 10, 9, '2009-01-03', 1, 4, 'Tired and falling down', 'This hotel is in serious need of refurbishment, the windows are rotting, the paintwork is tired and the carpets are from the 1970s.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (37, 10, 10, '2009-07-20', 0, 0, 'Not suitable for human habitation', 'I would not put my dog up in this hotel.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (38, 10, 11, '2010-05-20', 1, 0, 'Conveient for the railway', 'Average place but useful if you need to commute') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (39, 10, 12, '2010-01-22', 2, 2, 'Not as bad as the reviews', 'Some of the reviews seem a bit harsh, it''s not too bad for the price.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (40, 10, 13, '2011-01-10', 3, 1, 'Reburished and nice', 'Looks like this hotel has had a major facelift. If you have stayed before 2011 perhaps it''s time to give this hotel another try. Very good value for money and pretty nice.') -- London -insert into city(country, name, state, map) values ('UK', 'London', '', '51.500152, -0.126236') -insert into hotel(city_id, name, address, zip) values (10, 'Melia White House', 'Albany Street', 'NW1 3UP') +insert into city(id, country, name, state, map) values (10, 'UK', 'London', '', '51.500152, -0.126236') +insert into hotel(id, city_id, name, address, zip) values (11, 10, 'Melia White House', 'Albany Street', 'NW1 3UP') -- Southampton -insert into city(country, name, state, map) values ('UK', 'Southampton', 'Hampshire', '50.902571, -1.397238') -insert into hotel(city_id, name, address, zip) values (11, 'Chilworth Manor', 'The Cottage, Southampton Business Park', 'SO16 7JF') +insert into city(id, country, name, state, map) values (11, 'UK', 'Southampton', 'Hampshire', '50.902571, -1.397238') +insert into hotel(id, city_id, name, address, zip) values (12, 11, 'Chilworth Manor', 'The Cottage, Southampton Business Park', 'SO16 7JF') -- ================================================================================================= -- USA -- Atlanta -insert into city(country, name, state, map) values ('USA', 'Atlanta', 'GA', '33.748995, -84.387982') -insert into hotel(city_id, name, address, zip) values (12, 'Marriott Courtyard', 'Tower Place, Buckhead', '30305') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (13, 0, '2009-01-20', 3, 0, 'Better than most', 'Most other hotels is this area are a bit ropey, this one is actually pretty good.') -insert into hotel(city_id, name, address, zip) values (12, 'Ritz Carlton', 'Peachtree Rd, Buckhead', '30326') -insert into hotel(city_id, name, address, zip) values (12, 'Doubletree', 'Tower Place, Buckhead', '30305') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (15, 0, '2006-01-12', 2, 3, 'No fuss hotel', 'Cheap, no fuss hotel. Good if you are travelling on business and just need a place to stay.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (15, 1, '2009-01-20', 2, 2, 'Nice area but small rooms', 'The area felt nice and safe but the rooms are a little on the small side') +insert into city(id, country, name, state, map) values (12, 'USA', 'Atlanta', 'GA', '33.748995, -84.387982') +insert into hotel(id, city_id, name, address, zip) values (13, 12, 'Marriott Courtyard', 'Tower Place, Buckhead', '30305') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (41, 13, 0, '2009-01-20', 3, 0, 'Better than most', 'Most other hotels is this area are a bit ropey, this one is actually pretty good.') +insert into hotel(id, city_id, name, address, zip) values (14, 12, 'Ritz Carlton', 'Peachtree Rd, Buckhead', '30326') +insert into hotel(id, city_id, name, address, zip) values (15, 12, 'Doubletree', 'Tower Place, Buckhead', '30305') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (42, 15, 0, '2006-01-12', 2, 3, 'No fuss hotel', 'Cheap, no fuss hotel. Good if you are travelling on business and just need a place to stay.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (43, 15, 1, '2009-01-20', 2, 2, 'Nice area but small rooms', 'The area felt nice and safe but the rooms are a little on the small side') -- Chicago -insert into city(country, name, state, map) values ('USA', 'Chicago', 'IL', '41.878114, -87.629798') -insert into hotel(city_id, name, address, zip) values (13, 'Hotel Allegro', '171 West Randolph Street', '60601') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (16, 0, '2009-12-15', 3, 2, 'Cheap and Recommended', 'Good value for money, can''t really fault it.') +insert into city(id, country, name, state, map) values (13, 'USA', 'Chicago', 'IL', '41.878114, -87.629798') +insert into hotel(id, city_id, name, address, zip) values (16, 13, 'Hotel Allegro', '171 West Randolph Street', '60601') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (44, 16, 0, '2009-12-15', 3, 2, 'Cheap and Recommended', 'Good value for money, can''t really fault it.') -- Eau Claire -insert into city(country, name, state, map) values ('USA', 'Eau Claire', 'WI', '44.811349, -91.498494') -insert into hotel(city_id, name, address, zip) values (14, 'Sea Horse Inn', '2106 N Clairemont Ave', '54703') -insert into hotel(city_id, name, address, zip) values (14, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', '54701') +insert into city(id, country, name, state, map) values (14, 'USA', 'Eau Claire', 'WI', '44.811349, -91.498494') +insert into hotel(id, city_id, name, address, zip) values (17, 14, 'Sea Horse Inn', '2106 N Clairemont Ave', '54703') +insert into hotel(id, city_id, name, address, zip) values (18, 14, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', '54701') -- Hollywood -insert into city(country, name, state, map) values ('USA', 'Hollywood', 'FL', '26.011201, -80.14949') -insert into hotel(city_id, name, address, zip) values (15, 'Westin Diplomat', '3555 S. Ocean Drive', '33019') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (19, 0, '2006-01-11', 0, 0, 'Avoid', 'The hotel has a very bad reputation. I would avoid it if I were you.') +insert into city(id, country, name, state, map) values (15, 'USA', 'Hollywood', 'FL', '26.011201, -80.14949') +insert into hotel(id, city_id, name, address, zip) values (19, 15, 'Westin Diplomat', '3555 S. Ocean Drive', '33019') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (45, 19, 0, '2006-01-11', 0, 0, 'Avoid', 'The hotel has a very bad reputation. I would avoid it if I were you.') -- Miami -insert into city(country, name, state, map) values ('USA', 'Miami', 'FL', '25.788969, -80.226439') -insert into hotel(city_id, name, address, zip) values (16, 'Conrad Miami', '1395 Brickell Ave', '33131') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (20, 0, '2010-01-09', 3, 2, 'Close to the local attractions', 'Fantastic access to all the local attractions mean you won''t mind the small rooms.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (20, 1, '2010-09-10', 2, 2, 'Good value and friendly', 'Not expensive and very welcoming staff. I would stay again.') +insert into city(id, country, name, state, map) values (16, 'USA', 'Miami', 'FL', '25.788969, -80.226439') +insert into hotel(id, city_id, name, address, zip) values (20, 16, 'Conrad Miami', '1395 Brickell Ave', '33131') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (46, 20, 0, '2010-01-09', 3, 2, 'Close to the local attractions', 'Fantastic access to all the local attractions mean you won''t mind the small rooms.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (47, 20, 1, '2010-09-10', 2, 2, 'Good value and friendly', 'Not expensive and very welcoming staff. I would stay again.') -- Melbourne -insert into city(country, name, state, map) values ('USA', 'Melbourne', 'FL', '28.083627, -80.608109') -insert into hotel(city_id, name, address, zip) values (17, 'Radisson Suite Hotel Oceanfront', '3101 North Hwy', '32903') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (21, 0, '2005-06-15', 3, 3, 'A very nice hotel', 'I can''t fault this hotel and I have stayed here many times. Always friendly staff and lovely atmosphere.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (21, 1, '2006-01-20', 2, 4, 'Comfortable and good value', 'To complaints at all.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (21, 2, '2007-08-21', 3, 1, 'Above average', 'Better than a lot of hotels in the area and not too pricey.') +insert into city(id, country, name, state, map) values (17, 'USA', 'Melbourne', 'FL', '28.083627, -80.608109') +insert into hotel(id, city_id, name, address, zip) values (21, 17, 'Radisson Suite Hotel Oceanfront', '3101 North Hwy', '32903') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (48, 21, 0, '2005-06-15', 3, 3, 'A very nice hotel', 'I can''t fault this hotel and I have stayed here many times. Always friendly staff and lovely atmosphere.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (49, 21, 1, '2006-01-20', 2, 4, 'Comfortable and good value', 'To complaints at all.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (50, 21, 2, '2007-08-21', 3, 1, 'Above average', 'Better than a lot of hotels in the area and not too pricey.') -- New York -insert into city(country, name, state, map) values ('USA', 'New York', 'NY', '40.714353, -74.005973') -insert into hotel(city_id, name, address, zip) values (18, 'W Union Hotel', 'Union Square, Manhattan', '10011') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (22, 0, '2002-01-19', 0, 1, 'Too noisy, too small', 'The city never sleeps and neither will you if you say here. The rooms are small and the sound insulation is poor!') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (22, 1, '2004-03-10', 1, 4, 'Overpriced', 'Far too much money for such a tiny room!') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (22, 2, '2007-04-11', 2, 0, 'So so, nothing special', 'Not brilliant but not too bad either.') -insert into hotel(city_id, name, address, zip) values (18, 'W Lexington Hotel', 'Lexington Ave, Manhattan', '10011') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (23, 0, '2004-07-21', 3, 2, 'Excellent location', 'So close to the heart of the city. Recommended.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (23, 1, '2006-05-20', 3, 1, 'Very nice', 'I can''t fault this hotel, clean, good location and nice staff.') -insert into hotel(city_id, name, address, zip) values (18, '70 Park Avenue Hotel', '70 Park Avenue', '10011') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (24, 0, '2003-11-10', 4, 1, 'Great!!', 'I own this hotel and I think it is pretty darn good.') +insert into city(id, country, name, state, map) values (18, 'USA', 'New York', 'NY', '40.714353, -74.005973') +insert into hotel(id, city_id, name, address, zip) values (22, 18, 'W Union Hotel', 'Union Square, Manhattan', '10011') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (51, 22, 0, '2002-01-19', 0, 1, 'Too noisy, too small', 'The city never sleeps and neither will you if you say here. The rooms are small and the sound insulation is poor!') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (52, 22, 1, '2004-03-10', 1, 4, 'Overpriced', 'Far too much money for such a tiny room!') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (53, 22, 2, '2007-04-11', 2, 0, 'So so, nothing special', 'Not brilliant but not too bad either.') +insert into hotel(id, city_id, name, address, zip) values (23, 18, 'W Lexington Hotel', 'Lexington Ave, Manhattan', '10011') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (54, 23, 0, '2004-07-21', 3, 2, 'Excellent location', 'So close to the heart of the city. Recommended.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (55, 23, 1, '2006-05-20', 3, 1, 'Very nice', 'I can''t fault this hotel, clean, good location and nice staff.') +insert into hotel(id, city_id, name, address, zip) values (24, 18, '70 Park Avenue Hotel', '70 Park Avenue', '10011') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (56, 24, 0, '2003-11-10', 4, 1, 'Great!!', 'I own this hotel and I think it is pretty darn good.') -- Palm Bay -insert into city(country, name, state, map) values ('USA', 'Palm Bay', 'FL', '28.034462, -80.588665') -insert into hotel(city_id, name, address, zip) values (19, 'Jameson Inn', '890 Palm Bay Rd NE', '32905') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (25, 0, '2005-10-20', 3, 2, 'Fantastical', 'This is the BEST hotel in Palm Bay, not complaints at all.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (25, 1, '2006-01-12', 4, 1, 'Top marks', 'I rate this hotel 5 stars, the best in the area by miles.') +insert into city(id, country, name, state, map) values (19, 'USA', 'Palm Bay', 'FL', '28.034462, -80.588665') +insert into hotel(id, city_id, name, address, zip) values (25, 19, 'Jameson Inn', '890 Palm Bay Rd NE', '32905') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (57, 25, 0, '2005-10-20', 3, 2, 'Fantastical', 'This is the BEST hotel in Palm Bay, not complaints at all.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (58, 25, 1, '2006-01-12', 4, 1, 'Top marks', 'I rate this hotel 5 stars, the best in the area by miles.') -- San Francisco -insert into city(country, name, state, map) values ('USA', 'San Francisco', 'CA', '37.77493, -122.419415') -insert into hotel(city_id, name, address, zip) values (20, 'Marriot Downtown', '55 Fourth Street', '94103') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (26, 0, '2006-07-02', 2, 3, 'Could be better', 'I stayed in late 2006 with work, the room was very small and the restaurant does not stay open very late.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (26, 1, '2008-07-01', 1, 4, 'Brrrr cold!', 'My room was freezing cold, I would not recommend this place.') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (26, 2, '2009-01-05', 3, 2, 'Nice for money', 'You can''t really go wrong here for the money. There may be better places to stay but not for this price.') +insert into city(id, country, name, state, map) values (20, 'USA', 'San Francisco', 'CA', '37.77493, -122.419415') +insert into hotel(id, city_id, name, address, zip) values (26, 20, 'Marriot Downtown', '55 Fourth Street', '94103') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (59, 26, 0, '2006-07-02', 2, 3, 'Could be better', 'I stayed in late 2006 with work, the room was very small and the restaurant does not stay open very late.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (60, 26, 1, '2008-07-01', 1, 4, 'Brrrr cold!', 'My room was freezing cold, I would not recommend this place.') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (61, 26, 2, '2009-01-05', 3, 2, 'Nice for money', 'You can''t really go wrong here for the money. There may be better places to stay but not for this price.') -- Washington -insert into city(country, name, state, map) values ('USA', 'Washington', 'DC', '38.895112, -77.036366') -insert into hotel(city_id, name, address, zip) values (21, 'Hotel Rouge', '1315 16th Street NW', '20036') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (27, 0, '2000-01-29', 0, 2, 'Never again', 'I will never ever stay here again!! They wanted extra cash to get fresh batteries for the TV remote') -insert into review(hotel_id, idx, check_in_date, rating, trip_type, title, details) values (27, 1, '2006-02-20', 0, 0, 'Avoid', 'This place is the pits, they charged us twice for a single night stay. I only got refunded after contacting my credit card company.') +insert into city(id, country, name, state, map) values (21, 'USA', 'Washington', 'DC', '38.895112, -77.036366') +insert into hotel(id, city_id, name, address, zip) values (27, 21, 'Hotel Rouge', '1315 16th Street NW', '20036') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (62, 27, 0, '2000-01-29', 0, 2, 'Never again', 'I will never ever stay here again!! They wanted extra cash to get fresh batteries for the TV remote') +insert into review(id, hotel_id, idx, check_in_date, rating, trip_type, title, details) values (63, 27, 1, '2006-02-20', 0, 0, 'Avoid', 'This place is the pits, they charged us twice for a single night stay. I only got refunded after contacting my credit card company.') diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/SampleDataJpaApplicationTests.java b/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/SampleDataJpaApplicationTests.java index 9617a13a957d..b8c1b185aed2 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/SampleDataJpaApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/SampleDataJpaApplicationTests.java @@ -48,8 +48,7 @@ @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.jpa.hibernate.use-new-id-generator-mappings=false" }) + "spring.datasource.jmx-enabled:true" }) @ActiveProfiles("scratch") // Separate profile for web tests to avoid clashing databases public class SampleDataJpaApplicationTests { diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/CityRepositoryIntegrationTests.java b/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/CityRepositoryIntegrationTests.java index b0b07a6c99c0..7a07a94cc3fa 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/CityRepositoryIntegrationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/CityRepositoryIntegrationTests.java @@ -23,7 +23,6 @@ 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; @@ -35,7 +34,6 @@ */ @RunWith(SpringRunner.class) @SpringBootTest -@TestPropertySource(properties = "spring.jpa.hibernate.use-new-id-generator-mappings=false") public class CityRepositoryIntegrationTests { @Autowired diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/HotelRepositoryIntegrationTests.java b/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/HotelRepositoryIntegrationTests.java index 5b98188a6100..bb7753c18d9f 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/HotelRepositoryIntegrationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/HotelRepositoryIntegrationTests.java @@ -30,7 +30,6 @@ 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; @@ -42,7 +41,6 @@ */ @RunWith(SpringRunner.class) @SpringBootTest -@TestPropertySource(properties = "spring.jpa.hibernate.use-new-id-generator-mappings=false") public class HotelRepositoryIntegrationTests { @Autowired diff --git a/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/domain/City.java b/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/domain/City.java index 0de9f3d7243c..4987e3e46dbe 100644 --- a/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/domain/City.java +++ b/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/domain/City.java @@ -22,6 +22,7 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.SequenceGenerator; @Entity public class City implements Serializable { @@ -29,7 +30,8 @@ public class City implements Serializable { private static final long serialVersionUID = 1L; @Id - @GeneratedValue + @SequenceGenerator(name="city_generator", sequenceName="city_sequence", initialValue = 23) + @GeneratedValue(generator = "city_generator") private Long id; @Column(nullable = false) diff --git a/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/domain/Hotel.java b/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/domain/Hotel.java index f3c81a737120..34b478d92982 100644 --- a/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/domain/Hotel.java +++ b/spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/domain/Hotel.java @@ -23,6 +23,7 @@ import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; import org.hibernate.annotations.NaturalId; @@ -32,7 +33,8 @@ public class Hotel implements Serializable { private static final long serialVersionUID = 1L; @Id - @GeneratedValue + @SequenceGenerator(name="hotel_generator", sequenceName="hotel_sequence", initialValue = 28) + @GeneratedValue(generator = "hotel_generator") private Long id; @ManyToOne(optional = false) diff --git a/spring-boot-samples/spring-boot-sample-data-rest/src/main/resources/import.sql b/spring-boot-samples/spring-boot-sample-data-rest/src/main/resources/import.sql index 6f2753bda33e..d9c9a1e2ca5b 100644 --- a/spring-boot-samples/spring-boot-sample-data-rest/src/main/resources/import.sql +++ b/spring-boot-samples/spring-boot-sample-data-rest/src/main/resources/import.sql @@ -6,118 +6,116 @@ -- AUSTRALIA -- Brisbane -insert into city(country, name, state, map) values ('Australia', 'Brisbane', 'Queensland', '-27.470933, 153.023502') -insert into hotel(city_id, name, address, zip) values (1, 'Conrad Treasury Place', 'William & George Streets', '4001') +insert into city(id, country, name, state, map) values (1, 'Australia', 'Brisbane', 'Queensland', '-27.470933, 153.023502') +insert into hotel(id, city_id, name, address, zip) values (1, 1, 'Conrad Treasury Place', 'William & George Streets', '4001') -- Melbourne -insert into city(country, name, state, map) values ('Australia', 'Melbourne', 'Victoria', '-37.813187, 144.96298') -insert into hotel(city_id, name, address, zip) values (2, 'The Langham', '1 Southgate Ave, Southbank', '3006') +insert into city(id, country, name, state, map) values (2, 'Australia', 'Melbourne', 'Victoria', '-37.813187, 144.96298') +insert into hotel(id, city_id, name, address, zip) values (2, 2, 'The Langham', '1 Southgate Ave, Southbank', '3006') -- Sydney -insert into city(country, name, state, map) values ('Australia', 'Sydney', 'New South Wales', '-33.868901, 151.207091') -insert into hotel(city_id, name, address, zip) values (3, 'Swissotel', '68 Market Street', '2000') +insert into city(id, country, name, state, map) values (3, 'Australia', 'Sydney', 'New South Wales', '-33.868901, 151.207091') +insert into hotel(id, city_id, name, address, zip) values (3, 3, 'Swissotel', '68 Market Street', '2000') -- ================================================================================================= -- CANADA -- Montreal -insert into city(country, name, state, map) values ('Canada', 'Montreal', 'Quebec', '45.508889, -73.554167') -insert into hotel(city_id, name, address, zip) values (4, 'Ritz Carlton', '1228 Sherbrooke St', 'H3G1H6') +insert into city(id, country, name, state, map) values (4, 'Canada', 'Montreal', 'Quebec', '45.508889, -73.554167') +insert into hotel(id, city_id, name, address, zip) values (4, 4, 'Ritz Carlton', '1228 Sherbrooke St', 'H3G1H6') -- ================================================================================================= -- ISRAEL -- Tel Aviv -insert into city(country, name, state, map) values ('Israel', 'Tel Aviv', '', '32.066157, 34.777821') -insert into hotel(city_id, name, address, zip) values (5, 'Hilton Tel Aviv', 'Independence Park', '63405') +insert into city(id, country, name, state, map) values (5, 'Israel', 'Tel Aviv', '', '32.066157, 34.777821') +insert into hotel(id, city_id, name, address, zip) values (5, 5, 'Hilton Tel Aviv', 'Independence Park', '63405') -- ================================================================================================= -- JAPAN -- Tokyo -insert into city(country, name, state, map) values ('Japan', 'Tokyo', '', '35.689488, 139.691706') -insert into hotel(city_id, name, address, zip) values (6, 'InterContinental Tokyo Bay', 'Takeshiba Pier', '105') +insert into city(id, country, name, state, map) values (6, 'Japan', 'Tokyo', '', '35.689488, 139.691706') +insert into hotel(id, city_id, name, address, zip) values (6, 6, 'InterContinental Tokyo Bay', 'Takeshiba Pier', '105') -- ================================================================================================= -- SPAIN -- Barcelona -insert into city(country, name, state, map) values ('Spain', 'Barcelona', 'Catalunya', '41.387917, 2.169919') -insert into hotel(city_id, name, address, zip) values (7, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', '08019') +insert into city(id, country, name, state, map) values (7, 'Spain', 'Barcelona', 'Catalunya', '41.387917, 2.169919') +insert into hotel(id, city_id, name, address, zip) values (7, 7, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', '08019') -- ================================================================================================= -- SWITZERLAND -- Neuchatel -insert into city(country, name, state, map) values ('Switzerland', 'Neuchatel', '', '46.992979, 6.931933') -insert into hotel(city_id, name, address, zip) values (8, 'Hotel Beaulac', ' Esplanade Leopold-Robert 2', '2000') +insert into city(id, country, name, state, map) values (8, 'Switzerland', 'Neuchatel', '', '46.992979, 6.931933') +insert into hotel(id, city_id, name, address, zip) values (8, 8, 'Hotel Beaulac', ' Esplanade Leopold-Robert 2', '2000') -- ================================================================================================= -- UNITED KINGDOM -- Bath -insert into city(country, name, state, map) values ('UK', 'Bath', 'Somerset', '51.381428, -2.357454') -insert into hotel(city_id, name, address, zip) values (9, 'The Bath Priory Hotel', 'Weston Road', 'BA1 2XT') -insert into hotel(city_id, name, address, zip) values (9, 'Bath Travelodge', 'Rossiter Road, Widcombe Basin', 'BA2 4JP') +insert into city(id, country, name, state, map) values (9, 'UK', 'Bath', 'Somerset', '51.381428, -2.357454') +insert into hotel(id, city_id, name, address, zip) values (9, 9, 'The Bath Priory Hotel', 'Weston Road', 'BA1 2XT') +insert into hotel(id, city_id, name, address, zip) values (10, 9, 'Bath Travelodge', 'Rossiter Road, Widcombe Basin', 'BA2 4JP') -- London -insert into city(country, name, state, map) values ('UK', 'London', '', '51.500152, -0.126236') -insert into hotel(city_id, name, address, zip) values (10, 'Melia White House', 'Albany Street', 'NW1 3UP') +insert into city(id, country, name, state, map) values (10, 'UK', 'London', '', '51.500152, -0.126236') +insert into hotel(id, city_id, name, address, zip) values (11, 10, 'Melia White House', 'Albany Street', 'NW1 3UP') -- Southampton -insert into city(country, name, state, map) values ('UK', 'Southampton', 'Hampshire', '50.902571, -1.397238') -insert into hotel(city_id, name, address, zip) values (11, 'Chilworth Manor', 'The Cottage, Southampton Business Park', 'SO16 7JF') +insert into city(id, country, name, state, map) values (11, 'UK', 'Southampton', 'Hampshire', '50.902571, -1.397238') +insert into hotel(id, city_id, name, address, zip) values (12, 11, 'Chilworth Manor', 'The Cottage, Southampton Business Park', 'SO16 7JF') -- ================================================================================================= -- USA -- Atlanta -insert into city(country, name, state, map) values ('USA', 'Atlanta', 'GA', '33.748995, -84.387982') -insert into hotel(city_id, name, address, zip) values (12, 'Marriott Courtyard', 'Tower Place, Buckhead', '30305') -insert into hotel(city_id, name, address, zip) values (12, 'Ritz Carlton', 'Peachtree Rd, Buckhead', '30326') -insert into hotel(city_id, name, address, zip) values (12, 'Doubletree', 'Tower Place, Buckhead', '30305') +insert into city(id, country, name, state, map) values (12, 'USA', 'Atlanta', 'GA', '33.748995, -84.387982') +insert into hotel(id, city_id, name, address, zip) values (13, 12, 'Marriott Courtyard', 'Tower Place, Buckhead', '30305') -- Chicago -insert into city(country, name, state, map) values ('USA', 'Chicago', 'IL', '41.878114, -87.629798') -insert into hotel(city_id, name, address, zip) values (13, 'Hotel Allegro', '171 West Randolph Street', '60601') +insert into city(id, country, name, state, map) values (13, 'USA', 'Chicago', 'IL', '41.878114, -87.629798') +insert into hotel(id, city_id, name, address, zip) values (16, 13, 'Hotel Allegro', '171 West Randolph Street', '60601') -- Eau Claire -insert into city(country, name, state, map) values ('USA', 'Eau Claire', 'WI', '44.811349, -91.498494') -insert into hotel(city_id, name, address, zip) values (14, 'Sea Horse Inn', '2106 N Clairemont Ave', '54703') -insert into hotel(city_id, name, address, zip) values (14, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', '54701') +insert into city(id, country, name, state, map) values (14, 'USA', 'Eau Claire', 'WI', '44.811349, -91.498494') +insert into hotel(id, city_id, name, address, zip) values (17, 14, 'Sea Horse Inn', '2106 N Clairemont Ave', '54703') +insert into hotel(id, city_id, name, address, zip) values (18, 14, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', '54701') -- Hollywood -insert into city(country, name, state, map) values ('USA', 'Hollywood', 'FL', '26.011201, -80.14949') -insert into hotel(city_id, name, address, zip) values (15, 'Westin Diplomat', '3555 S. Ocean Drive', '33019') +insert into city(id, country, name, state, map) values (15, 'USA', 'Hollywood', 'FL', '26.011201, -80.14949') +insert into hotel(id, city_id, name, address, zip) values (19, 15, 'Westin Diplomat', '3555 S. Ocean Drive', '33019') -- Miami -insert into city(country, name, state, map) values ('USA', 'Miami', 'FL', '25.788969, -80.226439') -insert into hotel(city_id, name, address, zip) values (16, 'Conrad Miami', '1395 Brickell Ave', '33131') +insert into city(id, country, name, state, map) values (16, 'USA', 'Miami', 'FL', '25.788969, -80.226439') +insert into hotel(id, city_id, name, address, zip) values (20, 16, 'Conrad Miami', '1395 Brickell Ave', '33131') -- Melbourne -insert into city(country, name, state, map) values ('USA', 'Melbourne', 'FL', '28.083627, -80.608109') -insert into hotel(city_id, name, address, zip) values (17, 'Radisson Suite Hotel Oceanfront', '3101 North Hwy', '32903') +insert into city(id, country, name, state, map) values (17, 'USA', 'Melbourne', 'FL', '28.083627, -80.608109') +insert into hotel(id, city_id, name, address, zip) values (21, 17, 'Radisson Suite Hotel Oceanfront', '3101 North Hwy', '32903') -- New York -insert into city(country, name, state, map) values ('USA', 'New York', 'NY', '40.714353, -74.005973') -insert into hotel(city_id, name, address, zip) values (18, 'W Union Hotel', 'Union Square, Manhattan', '10011') -insert into hotel(city_id, name, address, zip) values (18, 'W Lexington Hotel', 'Lexington Ave, Manhattan', '10011') -insert into hotel(city_id, name, address, zip) values (18, '70 Park Avenue Hotel', '70 Park Avenue', '10011') +insert into city(id, country, name, state, map) values (18, 'USA', 'New York', 'NY', '40.714353, -74.005973') +insert into hotel(id, city_id, name, address, zip) values (22, 18, 'W Union Hotel', 'Union Square, Manhattan', '10011') +insert into hotel(id, city_id, name, address, zip) values (23, 18, 'W Lexington Hotel', 'Lexington Ave, Manhattan', '10011') +insert into hotel(id, city_id, name, address, zip) values (24, 18, '70 Park Avenue Hotel', '70 Park Avenue', '10011') -- Palm Bay -insert into city(country, name, state, map) values ('USA', 'Palm Bay', 'FL', '28.034462, -80.588665') -insert into hotel(city_id, name, address, zip) values (19, 'Jameson Inn', '890 Palm Bay Rd NE', '32905') +insert into city(id, country, name, state, map) values (19, 'USA', 'Palm Bay', 'FL', '28.034462, -80.588665') +insert into hotel(id, city_id, name, address, zip) values (25, 19, 'Jameson Inn', '890 Palm Bay Rd NE', '32905') -- San Francisco -insert into city(country, name, state, map) values ('USA', 'San Francisco', 'CA', '37.77493, -122.419415') -insert into hotel(city_id, name, address, zip) values (20, 'Marriot Downtown', '55 Fourth Street', '94103') +insert into city(id, country, name, state, map) values (20, 'USA', 'San Francisco', 'CA', '37.77493, -122.419415') +insert into hotel(id, city_id, name, address, zip) values (26, 20, 'Marriot Downtown', '55 Fourth Street', '94103') -- Washington -insert into city(country, name, state, map) values ('USA', 'Washington', 'DC', '38.895112, -77.036366') -insert into hotel(city_id, name, address, zip) values (21, 'Hotel Rouge', '1315 16th Street NW', '20036') +insert into city(id, country, name, state, map) values (21, 'USA', 'Washington', 'DC', '38.895112, -77.036366') +insert into hotel(id, city_id, name, address, zip) values (27, 21, 'Hotel Rouge', '1315 16th Street NW', '20036') diff --git a/spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/SampleDataRestApplicationTests.java b/spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/SampleDataRestApplicationTests.java index e42a141bce98..3c7ad8021555 100644 --- a/spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/SampleDataRestApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/SampleDataRestApplicationTests.java @@ -22,8 +22,6 @@ 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; @@ -45,8 +43,6 @@ */ @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 { diff --git a/spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/service/CityRepositoryIntegrationTests.java b/spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/service/CityRepositoryIntegrationTests.java index 11cfca8de561..a5ecded536c0 100644 --- a/spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/service/CityRepositoryIntegrationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/service/CityRepositoryIntegrationTests.java @@ -24,7 +24,6 @@ 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; @@ -37,7 +36,6 @@ */ @RunWith(SpringRunner.class) @SpringBootTest -@TestPropertySource(properties = "spring.jpa.hibernate.use-new-id-generator-mappings=false") public class CityRepositoryIntegrationTests { @Autowired diff --git a/spring-boot-samples/spring-boot-sample-flyway/src/main/java/sample/flyway/Person.java b/spring-boot-samples/spring-boot-sample-flyway/src/main/java/sample/flyway/Person.java index f9c90eae84a7..4eeb005dc4ff 100644 --- a/spring-boot-samples/spring-boot-sample-flyway/src/main/java/sample/flyway/Person.java +++ b/spring-boot-samples/spring-boot-sample-flyway/src/main/java/sample/flyway/Person.java @@ -19,11 +19,13 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.SequenceGenerator; @Entity public class Person { @Id - @GeneratedValue + @SequenceGenerator(name="person_generator", sequenceName="person_sequence", allocationSize = 1) + @GeneratedValue(generator = "person_generator") private Long id; private String firstName; private String lastName; diff --git a/spring-boot-samples/spring-boot-sample-flyway/src/main/resources/db/migration/V1__init.sql b/spring-boot-samples/spring-boot-sample-flyway/src/main/resources/db/migration/V1__init.sql index e6ac47ce656a..ff78aa69cf9d 100644 --- a/spring-boot-samples/spring-boot-sample-flyway/src/main/resources/db/migration/V1__init.sql +++ b/spring-boot-samples/spring-boot-sample-flyway/src/main/resources/db/migration/V1__init.sql @@ -4,4 +4,6 @@ CREATE TABLE PERSON ( last_name varchar(255) not null ); +create sequence person_sequence start with 1 increment by 1; + insert into PERSON (first_name, last_name) values ('Dave', 'Syer'); \ No newline at end of file diff --git a/spring-boot-samples/spring-boot-sample-flyway/src/test/java/sample/flyway/SampleFlywayApplicationTests.java b/spring-boot-samples/spring-boot-sample-flyway/src/test/java/sample/flyway/SampleFlywayApplicationTests.java index ddcb01d1728e..cb96e82c3c21 100644 --- a/spring-boot-samples/spring-boot-sample-flyway/src/test/java/sample/flyway/SampleFlywayApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-flyway/src/test/java/sample/flyway/SampleFlywayApplicationTests.java @@ -22,14 +22,12 @@ 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 diff --git a/spring-boot-samples/spring-boot-sample-jpa/src/main/java/sample/jpa/domain/Note.java b/spring-boot-samples/spring-boot-sample-jpa/src/main/java/sample/jpa/domain/Note.java index 9a2442c3c206..999dcdceb107 100644 --- a/spring-boot-samples/spring-boot-sample-jpa/src/main/java/sample/jpa/domain/Note.java +++ b/spring-boot-samples/spring-boot-sample-jpa/src/main/java/sample/jpa/domain/Note.java @@ -20,15 +20,16 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToMany; +import javax.persistence.SequenceGenerator; @Entity public class Note { @Id - @GeneratedValue(strategy = GenerationType.AUTO) + @SequenceGenerator(name="note_generator", sequenceName="note_sequence", initialValue = 5) + @GeneratedValue(generator = "note_generator") private long id; private String title; diff --git a/spring-boot-samples/spring-boot-sample-jpa/src/main/java/sample/jpa/domain/Tag.java b/spring-boot-samples/spring-boot-sample-jpa/src/main/java/sample/jpa/domain/Tag.java index 4d8bfc09d1cc..fb24a83e050d 100644 --- a/spring-boot-samples/spring-boot-sample-jpa/src/main/java/sample/jpa/domain/Tag.java +++ b/spring-boot-samples/spring-boot-sample-jpa/src/main/java/sample/jpa/domain/Tag.java @@ -23,12 +23,14 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToMany; +import javax.persistence.SequenceGenerator; @Entity public class Tag { @Id - @GeneratedValue(strategy = GenerationType.AUTO) + @SequenceGenerator(name="tag_generator", sequenceName="tag_sequence", initialValue = 4) + @GeneratedValue(generator = "tag_generator") private long id; private String name; diff --git a/spring-boot-samples/spring-boot-sample-jpa/src/main/resources/import.sql b/spring-boot-samples/spring-boot-sample-jpa/src/main/resources/import.sql index a3d2222035ef..6917db6f51f7 100644 --- a/spring-boot-samples/spring-boot-sample-jpa/src/main/resources/import.sql +++ b/spring-boot-samples/spring-boot-sample-jpa/src/main/resources/import.sql @@ -1,11 +1,11 @@ -insert into tag(name) values ('Spring projects') -insert into tag(name) values ('Apache projects') -insert into tag(name) values ('Open source') +insert into tag(id, name) values (1, 'Spring projects') +insert into tag(id, name) values (2, 'Apache projects') +insert into tag(id, name) values (3, 'Open source') -insert into note(title, body) values ('Spring Boot', 'Takes an opinionated view of building production-ready Spring applications.') -insert into note(title, body) values ('Spring Framework', 'Core support for dependency injection, transaction management, web applications, data access, messaging, testing and more.') -insert into note(title, body) values ('Spring Integration', 'Extends the Spring programming model to support the well-known Enterprise Integration Patterns.') -insert into note(title, body) values ('Tomcat', 'Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies.') +insert into note(id, title, body) values (1, 'Spring Boot', 'Takes an opinionated view of building production-ready Spring applications.') +insert into note(id, title, body) values (2, 'Spring Framework', 'Core support for dependency injection, transaction management, web applications, data access, messaging, testing and more.') +insert into note(id, title, body) values (3, 'Spring Integration', 'Extends the Spring programming model to support the well-known Enterprise Integration Patterns.') +insert into note(id, title, body) values (4, 'Tomcat', 'Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies.') insert into note_tags(notes_id, tags_id) values (1, 1) insert into note_tags(notes_id, tags_id) values (2, 1) diff --git a/spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/SampleJpaApplicationTests.java b/spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/SampleJpaApplicationTests.java index d4bf3ec563d7..74da60edfbb7 100644 --- a/spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/SampleJpaApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/SampleJpaApplicationTests.java @@ -22,7 +22,6 @@ 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; @@ -41,7 +40,6 @@ */ @RunWith(SpringRunner.class) @SpringBootTest -@TestPropertySource(properties = "spring.jpa.hibernate.use-new-id-generator-mappings=false") @WebAppConfiguration public class SampleJpaApplicationTests { diff --git a/spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/repository/JpaNoteRepositoryIntegrationTests.java b/spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/repository/JpaNoteRepositoryIntegrationTests.java index 4e19c5d9b320..d1a2c8cf4bbd 100644 --- a/spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/repository/JpaNoteRepositoryIntegrationTests.java +++ b/spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/repository/JpaNoteRepositoryIntegrationTests.java @@ -23,7 +23,6 @@ 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; @@ -36,7 +35,6 @@ */ @RunWith(SpringRunner.class) @SpringBootTest -@TestPropertySource(properties = "spring.jpa.hibernate.use-new-id-generator-mappings=false") @Transactional public class JpaNoteRepositoryIntegrationTests { diff --git a/spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/repository/JpaTagRepositoryIntegrationTests.java b/spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/repository/JpaTagRepositoryIntegrationTests.java index 17fb571afb33..cabd301fce62 100644 --- a/spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/repository/JpaTagRepositoryIntegrationTests.java +++ b/spring-boot-samples/spring-boot-sample-jpa/src/test/java/sample/jpa/repository/JpaTagRepositoryIntegrationTests.java @@ -23,7 +23,6 @@ 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; @@ -36,7 +35,6 @@ */ @RunWith(SpringRunner.class) @SpringBootTest -@TestPropertySource(properties = "spring.jpa.hibernate.use-new-id-generator-mappings=false") @Transactional public class JpaTagRepositoryIntegrationTests {