Restructure 'bootstrap' to use 'zero'

This commit is contained in:
Phillip Webb
2013-07-05 16:44:24 -07:00
parent d039822064
commit 261955c50b
443 changed files with 1361 additions and 1774 deletions

View File

@@ -14,20 +14,20 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data;
package org.springframework.zero.sample.data.jpa;
import org.springframework.bootstrap.SpringApplication;
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.zero.SpringApplication;
import org.springframework.zero.context.annotation.EnableAutoConfiguration;
@Configuration
@ComponentScan
@EnableAutoConfiguration
public class DataBootstrapApplication {
public class SampleDataJpaApplication {
public static void main(String[] args) throws Exception {
SpringApplication.run(DataBootstrapApplication.class, args);
SpringApplication.run(SampleDataJpaApplication.class, args);
}
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.domain;
package org.springframework.zero.sample.data.jpa.domain;
import java.io.Serializable;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.domain;
package org.springframework.zero.sample.data.jpa.domain;
import java.io.Serializable;
import java.util.Set;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.domain;
package org.springframework.zero.sample.data.jpa.domain;
import java.io.Serializable;
import java.math.BigDecimal;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.domain;
package org.springframework.zero.sample.data.jpa.domain;
public enum Rating {
TERRIBLE, POOR, AVERAGE, GOOD, EXCELLENT,

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.domain;
package org.springframework.zero.sample.data.jpa.domain;
import java.io.Serializable;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.domain;
package org.springframework.zero.sample.data.jpa.domain;
import java.io.Serializable;
import java.util.Date;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.domain;
package org.springframework.zero.sample.data.jpa.domain;
import java.io.Serializable;
import java.util.Date;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.domain;
package org.springframework.zero.sample.data.jpa.domain;
public enum TripType {
BUSINESS, COUPLES, FAMILY, FRIENDS, SOLO

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.domain.repository;
package org.springframework.zero.sample.data.jpa.domain.repository;
import org.springframework.bootstrap.sample.data.domain.City;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.Repository;
import org.springframework.zero.sample.data.jpa.domain.City;
public interface CityRepository extends Repository<City, Long> {

View File

@@ -14,11 +14,11 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.domain.repository;
package org.springframework.zero.sample.data.jpa.domain.repository;
import org.springframework.bootstrap.sample.data.domain.City;
import org.springframework.bootstrap.sample.data.domain.Hotel;
import org.springframework.data.repository.Repository;
import org.springframework.zero.sample.data.jpa.domain.City;
import org.springframework.zero.sample.data.jpa.domain.Hotel;
public interface HotelRepository extends Repository<Hotel, Long> {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.domain.repository;
package org.springframework.zero.sample.data.jpa.domain.repository;
import java.util.List;
import java.util.Locale;
@@ -23,16 +23,16 @@ import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import org.springframework.bootstrap.sample.data.domain.City;
import org.springframework.bootstrap.sample.data.domain.Hotel;
import org.springframework.bootstrap.sample.data.domain.HotelSummary;
import org.springframework.bootstrap.sample.data.domain.RatingCount;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Order;
import org.springframework.stereotype.Repository;
import org.springframework.zero.sample.data.jpa.domain.City;
import org.springframework.zero.sample.data.jpa.domain.Hotel;
import org.springframework.zero.sample.data.jpa.domain.HotelSummary;
import org.springframework.zero.sample.data.jpa.domain.RatingCount;
@Repository
public class HotelSummaryRepository {

View File

@@ -14,13 +14,13 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.domain.repository;
package org.springframework.zero.sample.data.jpa.domain.repository;
import org.springframework.bootstrap.sample.data.domain.Hotel;
import org.springframework.bootstrap.sample.data.domain.Review;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.Repository;
import org.springframework.zero.sample.data.jpa.domain.Hotel;
import org.springframework.zero.sample.data.jpa.domain.Review;
public interface ReviewRepository extends Repository<Review, Long> {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.service;
package org.springframework.zero.sample.data.jpa.service;
import java.io.Serializable;

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.service;
package org.springframework.zero.sample.data.jpa.service;
import org.springframework.bootstrap.sample.data.domain.City;
import org.springframework.bootstrap.sample.data.domain.HotelSummary;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.zero.sample.data.jpa.domain.City;
import org.springframework.zero.sample.data.jpa.domain.HotelSummary;
public interface CityService {

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.service;
package org.springframework.zero.sample.data.jpa.service;
import org.springframework.bootstrap.sample.data.domain.City;
import org.springframework.bootstrap.sample.data.domain.Hotel;
import org.springframework.bootstrap.sample.data.domain.Review;
import org.springframework.bootstrap.sample.data.domain.ReviewDetails;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.zero.sample.data.jpa.domain.City;
import org.springframework.zero.sample.data.jpa.domain.Hotel;
import org.springframework.zero.sample.data.jpa.domain.Review;
import org.springframework.zero.sample.data.jpa.domain.ReviewDetails;
public interface HotelService {

View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.service;
package org.springframework.zero.sample.data.jpa.service;
import org.springframework.bootstrap.sample.data.domain.Rating;
import org.springframework.zero.sample.data.jpa.domain.Rating;
public interface ReviewsSummary {

View File

@@ -14,21 +14,21 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.service.impl;
package org.springframework.zero.sample.data.jpa.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.bootstrap.sample.data.domain.City;
import org.springframework.bootstrap.sample.data.domain.HotelSummary;
import org.springframework.bootstrap.sample.data.domain.repository.CityRepository;
import org.springframework.bootstrap.sample.data.domain.repository.HotelSummaryRepository;
import org.springframework.bootstrap.sample.data.service.CitySearchCriteria;
import org.springframework.bootstrap.sample.data.service.CityService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.zero.sample.data.jpa.domain.City;
import org.springframework.zero.sample.data.jpa.domain.HotelSummary;
import org.springframework.zero.sample.data.jpa.domain.repository.CityRepository;
import org.springframework.zero.sample.data.jpa.domain.repository.HotelSummaryRepository;
import org.springframework.zero.sample.data.jpa.service.CitySearchCriteria;
import org.springframework.zero.sample.data.jpa.service.CityService;
@Component("cityService")
@Transactional

View File

@@ -14,29 +14,29 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.service.impl;
package org.springframework.zero.sample.data.jpa.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.bootstrap.sample.data.domain.City;
import org.springframework.bootstrap.sample.data.domain.Hotel;
import org.springframework.bootstrap.sample.data.domain.Rating;
import org.springframework.bootstrap.sample.data.domain.RatingCount;
import org.springframework.bootstrap.sample.data.domain.Review;
import org.springframework.bootstrap.sample.data.domain.ReviewDetails;
import org.springframework.bootstrap.sample.data.domain.repository.HotelRepository;
import org.springframework.bootstrap.sample.data.domain.repository.HotelSummaryRepository;
import org.springframework.bootstrap.sample.data.domain.repository.ReviewRepository;
import org.springframework.bootstrap.sample.data.service.HotelService;
import org.springframework.bootstrap.sample.data.service.ReviewsSummary;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.zero.sample.data.jpa.domain.City;
import org.springframework.zero.sample.data.jpa.domain.Hotel;
import org.springframework.zero.sample.data.jpa.domain.Rating;
import org.springframework.zero.sample.data.jpa.domain.RatingCount;
import org.springframework.zero.sample.data.jpa.domain.Review;
import org.springframework.zero.sample.data.jpa.domain.ReviewDetails;
import org.springframework.zero.sample.data.jpa.domain.repository.HotelRepository;
import org.springframework.zero.sample.data.jpa.domain.repository.HotelSummaryRepository;
import org.springframework.zero.sample.data.jpa.domain.repository.ReviewRepository;
import org.springframework.zero.sample.data.jpa.service.HotelService;
import org.springframework.zero.sample.data.jpa.service.ReviewsSummary;
@Component("hotelService")
@Transactional

View File

@@ -14,13 +14,13 @@
* limitations under the License.
*/
package org.springframework.bootstrap.sample.data.web;
package org.springframework.zero.sample.data.jpa.web;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.bootstrap.sample.data.service.CityService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.zero.sample.data.jpa.service.CityService;
@Controller
public class SampleController {

View File

@@ -1,4 +1,4 @@
package org.springframework.bootstrap.sample.data;
package org.springframework.zero.sample.data.jpa;
import java.io.IOException;
import java.util.concurrent.Callable;
@@ -9,13 +9,14 @@ import java.util.concurrent.TimeUnit;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.bootstrap.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestTemplate;
import org.springframework.zero.SpringApplication;
import org.springframework.zero.sample.data.jpa.SampleDataJpaApplication;
import static org.junit.Assert.assertEquals;
@@ -24,7 +25,7 @@ import static org.junit.Assert.assertEquals;
*
* @author Dave Syer
*/
public class DataBootstrapApplicationTests {
public class SampleDataJpaApplicationTests {
private static ConfigurableApplicationContext context;
@@ -36,7 +37,7 @@ public class DataBootstrapApplicationTests {
@Override
public ConfigurableApplicationContext call() throws Exception {
return (ConfigurableApplicationContext) SpringApplication
.run(DataBootstrapApplication.class);
.run(SampleDataJpaApplication.class);
}
});
context = future.get(10, TimeUnit.SECONDS);