#115 - Harmonized package names.

We now consistently use example.springdata.$store as base package name.
This commit is contained in:
Oliver Gierke
2015-07-16 09:02:24 +02:00
parent 50cb4b9bba
commit bca4e65e4f
94 changed files with 388 additions and 302 deletions

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.cassandra.simple;
package example.springdata.cassandra;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cassandra.config.java.AbstractCqlTemplateConfiguration;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.cassandra.simple;
package example.springdata.cassandra;
import org.springframework.data.repository.CrudRepository;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.cassandra.simple;
package example.springdata.cassandra;
import lombok.Data;
import lombok.NoArgsConstructor;

View File

@@ -1,5 +1,5 @@
/**
* Package showing a simple repository interface to use basic query method execution functionality.
*/
package example.springdata.cassandra.simple;
package example.springdata.cassandra;

View File

@@ -13,11 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.cassandra.simple;
package example.springdata.cassandra;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import example.springdata.cassandra.SimpleConfiguration;
import example.springdata.cassandra.SimpleUserRepository;
import example.springdata.cassandra.User;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.elasticsearch;
package example.springdata.elasticsearch.conference;
import java.util.Arrays;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.elasticsearch;
package example.springdata.elasticsearch.conference;
import static org.springframework.data.elasticsearch.annotations.FieldType.*;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.elasticsearch;
package example.springdata.elasticsearch.conference;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

View File

@@ -13,12 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.elasticsearch;
package example.springdata.elasticsearch.conference;
import static org.elasticsearch.index.query.QueryBuilders.*;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import example.springdata.elasticsearch.conference.ApplicationConfiguration;
import example.springdata.elasticsearch.conference.Conference;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.eclipselink;
package example.springdata.jpa.eclipselink;
import java.util.Collections;
import java.util.Map;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.eclipselink;
package example.springdata.jpa.eclipselink;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.eclipselink;
package example.springdata.jpa.eclipselink;
import org.springframework.data.repository.CrudRepository;

View File

@@ -13,11 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.eclipselink;
package example.springdata.jpa.eclipselink;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import example.springdata.jpa.eclipselink.Application;
import example.springdata.jpa.eclipselink.Customer;
import example.springdata.jpa.eclipselink.CustomerRepository;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example;
package example.springdata.map;
import java.util.UUID;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example;
package example.springdata.map;
import java.util.List;
import java.util.UUID;
@@ -25,7 +25,7 @@ import org.springframework.data.repository.CrudRepository;
*
* @author Oliver Gierke
*/
public interface PersonRepository extends CrudRepository<Person, UUID> {
interface PersonRepository extends CrudRepository<Person, UUID> {
/**
* Returns all person older than the given age.

View File

@@ -13,11 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example;
package example.springdata.map;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import example.springdata.map.Person;
import example.springdata.map.PersonRepository;
import java.util.List;
import org.junit.Test;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb.shop;
package example.springdata.mongodb.aggregation;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Configuration;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb.shop;
package example.springdata.mongodb.aggregation;
import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb.shop;
package example.springdata.mongodb.aggregation;
import lombok.Data;
import lombok.RequiredArgsConstructor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb.shop;
package example.springdata.mongodb.aggregation;
import java.util.ArrayList;
import java.util.Date;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb.shop;
package example.springdata.mongodb.aggregation;
import org.springframework.data.repository.CrudRepository;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb.shop;
package example.springdata.mongodb.aggregation;
/**
* The interface for repository functionality that will be implemented manually.

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb.shop;
package example.springdata.mongodb.aggregation;
import static org.springframework.data.mongodb.core.aggregation.Aggregation.*;
import static org.springframework.data.mongodb.core.query.Criteria.*;
@@ -43,7 +43,7 @@ class OrderRepositoryImpl implements OrderRepositoryCustom {
* to define arithmetical expressions. Note how we work with property names only and don't have to mitigate the nested
* {@code $_id} fields MongoDB usually requires.
*
* @see example.springdata.mongodb.shop.OrderRepositoryCustom#getInvoiceFor(example.springdata.mongodb.shop.Order)
* @see example.springdata.mongodb.aggregation.OrderRepositoryCustom#getInvoiceFor(example.springdata.mongodb.aggregation.Order)
*/
@Override
public Invoice getInvoiceFor(Order order) {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb.shop;
package example.springdata.mongodb.aggregation;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.number.IsCloseTo.*;
@@ -29,6 +29,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import example.springdata.mongodb.aggregation.ApplicationConfiguration;
import example.springdata.mongodb.aggregation.Invoice;
import example.springdata.mongodb.aggregation.LineItem;
import example.springdata.mongodb.aggregation.Order;
import example.springdata.mongodb.aggregation.OrderRepository;
import example.springdata.mongodb.util.RequiresMongoDB;
/**

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb;
package example.springdata.mongodb.geojson;
import static com.fasterxml.jackson.databind.DeserializationFeature.*;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb;
package example.springdata.mongodb.geojson;
import lombok.Data;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb;
package example.springdata.mongodb.geojson;
import java.util.List;

File diff suppressed because it is too large Load Diff

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb;
package example.springdata.mongodb.geojson;
import org.junit.ClassRule;
import org.junit.Test;
@@ -34,6 +34,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;
import example.springdata.mongodb.geojson.Application;
import example.springdata.mongodb.geojson.Store;
import example.springdata.mongodb.geojson.StoreRepository;
import example.springdata.mongodb.util.RequiresMongoDB;
/**

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.people;
package example.springdata.mongodb.security;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.people;
package example.springdata.mongodb.security;
import lombok.Data;
import lombok.RequiredArgsConstructor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.people;
package example.springdata.mongodb.security;
import java.util.List;

View File

@@ -13,11 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.people;
package example.springdata.mongodb.security;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import example.springdata.mongodb.security.Application;
import example.springdata.mongodb.security.Person;
import example.springdata.mongodb.security.PersonRepository;
import example.springdata.mongodb.util.RequiresMongoDB;
import java.util.Collections;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.headers;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.headers;
import example.springdata.rest.headers.Customer.Gender;
import javax.annotation.PostConstruct;
@@ -22,8 +24,6 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import example.orders.Customer.Gender;
/**
* @author Oliver Gierke
* @soundtrack The Intersphere - Out of phase (Live at Alte Feuerwache Mannheim)

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.headers;
import java.time.LocalDateTime;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.headers;
import org.springframework.data.repository.CrudRepository;

View File

@@ -13,11 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.headers;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import example.springdata.rest.headers.Application;
import example.springdata.rest.headers.Customer;
import example.springdata.rest.headers.CustomerRepository;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.headers;
import static org.hamcrest.CoreMatchers.*;
import static org.springframework.http.HttpHeaders.*;
@@ -21,6 +21,10 @@ import static org.springframework.restdocs.RestDocumentation.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import example.springdata.rest.headers.Application;
import example.springdata.rest.headers.Customer;
import example.springdata.rest.headers.CustomerRepository;
import java.net.URI;
import org.junit.Before;

View File

@@ -0,0 +1,27 @@
/*
* Copyright 2014-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.multistore;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* Application configuration file. Used for bootstrap and data setup.
*
* @author Greg Turnquist
* @author Oliver Gierke
*/
@SpringBootApplication
public class Application {}

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.person;
package example.springdata.multistore.person;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.person;
package example.springdata.multistore.person;
import org.springframework.data.repository.CrudRepository;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.treasure;
package example.springdata.multistore.treasure;
import lombok.Data;
import lombok.RequiredArgsConstructor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.treasure;
package example.springdata.multistore.treasure;
import org.springframework.data.repository.CrudRepository;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,47 +13,35 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example;
package example.springdata.multistore;
import javax.annotation.PostConstruct;
import example.springdata.multistore.person.Person;
import example.springdata.multistore.person.PersonRepository;
import example.springdata.multistore.treasure.Treasure;
import example.springdata.multistore.treasure.TreasureRepository;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
import example.person.Person;
import example.person.PersonRepository;
import example.treasure.Treasure;
import example.treasure.TreasureRepository;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* Application configuration file. Used for bootstrap and data setup.
*
* @author Greg Turnquist
* Integration test to show the usage of repositories backed by different stores.
*
* @author Oliver Gierke
*/
@Configuration
@EnableAutoConfiguration
@EnableJpaRepositories
@EnableMongoRepositories
public class Application {
private static final Logger log = LoggerFactory.getLogger(Application.class);
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
public class ApplicationIntegrationTests {
@Autowired PersonRepository personRepository;
@Autowired TreasureRepository treasureRepository;
@PostConstruct
void checkitOut() {
@Test
public void useMultipleRepositories() {
personRepository.save(new Person("Frodo", "Baggins"));
personRepository.save(new Person("Bilbo", "Baggins"));

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.projections;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.projections;
import example.springdata.rest.projections.Customer.Gender;
import java.math.BigDecimal;
@@ -23,8 +25,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import example.orders.Customer.Gender;
/**
* @author Oliver Gierke
*/

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.projections;
import javax.persistence.CascadeType;
import javax.persistence.Entity;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.projections;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.rest.core.config.Projection;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.projections;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.projections;
import java.math.BigDecimal;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.projections;
import java.util.ArrayList;
import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.projections;
import org.springframework.data.repository.CrudRepository;

View File

@@ -13,11 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.projections;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import example.springdata.rest.projections.Application;
import example.springdata.rest.projections.Order;
import example.springdata.rest.projections.OrderRepository;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.orders;
package example.springdata.rest.projections;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.company;
package example.springdata.rest.security;
import javax.annotation.PostConstruct;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.company;
package example.springdata.rest.security;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.company;
package example.springdata.rest.security;
import org.springframework.data.repository.CrudRepository;
/**
* This repository has no method-level security annotations. That's because it's secured at the URL level inside
* {@link example.company.SecurityConfiguration}.
* {@link example.springdata.rest.security.SecurityConfiguration}.
*
* @author Greg Turnquist
*/

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.company;
package example.springdata.rest.security;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.company;
package example.springdata.rest.security;
import org.springframework.data.repository.CrudRepository;
import org.springframework.security.access.prepost.PreAuthorize;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.company;
package example.springdata.rest.security;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.company;
package example.springdata.rest.security;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.authority.AuthorityUtils;

View File

@@ -13,10 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.company;
package example.springdata.rest.security;
import static org.junit.Assert.*;
import example.springdata.rest.security.Application;
import example.springdata.rest.security.Item;
import example.springdata.rest.security.ItemRepository;
import example.springdata.rest.security.SecurityConfiguration;
import example.springdata.rest.security.SecurityUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.company;
package example.springdata.rest.security;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
@@ -22,6 +22,10 @@ import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.*;
import example.springdata.rest.security.Application;
import example.springdata.rest.security.Employee;
import example.springdata.rest.security.SecurityConfiguration;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.stores;
package example.springdata.rest.stores;
import static org.springframework.data.mongodb.core.index.GeoSpatialIndexType.*;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.stores;
package example.springdata.rest.stores;
import lombok.Data;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.stores;
package example.springdata.rest.stores;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.stores;
package example.springdata.rest.stores;
import java.util.ArrayList;
import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.stores;
package example.springdata.rest.stores;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.stores;
package example.springdata.rest.stores;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@@ -13,10 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.stores.web;
package example.springdata.rest.stores.web;
import static org.springframework.data.geo.Metrics.*;
import example.springdata.rest.stores.Store;
import example.springdata.rest.stores.StoreRepository;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
@@ -39,9 +42,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import example.stores.Store;
import example.stores.StoreRepository;
/**
* A Spring MVC controller to produce an HTML frontend.
*

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.stores;
package example.springdata.rest.stores;
import static org.springframework.hateoas.MediaTypes.*;

View File

@@ -13,11 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.stores;
package example.springdata.rest.stores;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import example.springdata.rest.stores.Address;
import example.springdata.rest.stores.Store;
import example.springdata.rest.stores.StoreApp;
import example.springdata.rest.stores.StoreRepository;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.solr;
package example.springdata.solr.product;
import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.solr;
package example.springdata.solr.product;
import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.solr;
package example.springdata.solr.product;
import org.springframework.data.repository.Repository;
import org.springframework.data.solr.core.query.result.Cursor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.solr;
package example.springdata.solr.product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;

View File

@@ -38,6 +38,8 @@ import org.springframework.data.solr.repository.Boost;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import example.springdata.solr.product.Product;
import example.springdata.solr.product.ProductRepository;
import example.springdata.solr.test.util.RequiresSolrServer;
/**

View File

@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import example.springdata.solr.product.ProductRepository;
import example.springdata.solr.test.util.RequiresSolrServer;
/**

View File

@@ -15,6 +15,8 @@
*/
package example.springdata.solr;
import example.springdata.solr.product.Product;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.solr;
package example.springdata.solr.product;
import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.solr;
package example.springdata.solr.product;
import org.springframework.data.repository.CrudRepository;

View File

@@ -22,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import example.springdata.solr.product.ManagedProduct;
import example.springdata.solr.product.ProductRepository;
import example.springdata.solr.test.util.RequiresSolrServer;
/**

View File

@@ -15,6 +15,8 @@
*/
package example.springdata.solr;
import example.springdata.solr.product.ProductRepository;
import javax.annotation.PreDestroy;
import org.apache.solr.client.solrj.SolrServer;

View File

@@ -13,7 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example;
package example.springdata.web;
import example.springdata.web.users.Password;
import example.springdata.web.users.UserManagement;
import example.springdata.web.users.Username;
import java.util.stream.IntStream;
@@ -29,10 +33,6 @@ import org.springframework.data.web.config.EnableSpringDataWebSupport;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import example.users.Password;
import example.users.UserManagement;
import example.users.Username;
/**
* Central Spring Boot application class to bootstrap the application. Excludes Spring Security auto-configuration as we
* don't need it for the example but only want to use a {@link PasswordEncoder} (see {@link #passwordEncoder()}).
@@ -41,9 +41,9 @@ import example.users.Username;
* {@link EnableSpringDataWebSupport}. The core aspects of the enabled functionality shown in this example are:
* <ol>
* <li>Automatic population of a {@link Pageable} instances from request parameters (see
* {@link example.users.web.UserController#users(Pageable)})</li>
* {@link example.springdata.web.users.web.UserController#users(Pageable)})</li>
* <li>The ability to use proxy-backed interfaces to bind request payloads (see
* {@link example.users.web.UserController.UserForm})</li>
* {@link example.springdata.web.users.web.UserController.UserForm})</li>
* </ol>
*
* @author Oliver Gierke

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.users;
package example.springdata.web.users;
import javax.persistence.Embeddable;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.users;
package example.springdata.web.users;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.users;
package example.springdata.web.users;
import java.util.Optional;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.users;
package example.springdata.web.users;
import java.util.Optional;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.users;
package example.springdata.web.users;
import javax.persistence.Embeddable;

View File

@@ -13,10 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.users.web;
package example.springdata.web.users.web;
import static org.springframework.validation.ValidationUtils.*;
import example.springdata.web.users.Password;
import example.springdata.web.users.User;
import example.springdata.web.users.UserManagement;
import example.springdata.web.users.Username;
import java.util.Map;
import lombok.RequiredArgsConstructor;
@@ -35,11 +40,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.view.RedirectView;
import example.users.Password;
import example.users.User;
import example.users.UserManagement;
import example.users.Username;
/**
* A sample controller implementation to showcase Spring Data web support:
* <ol>

View File

@@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.users;
package example.springdata.web.users;
import example.springdata.web.Application;
import org.junit.runner.RunWith;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import example.Application;
/**
* Integration tests to bootstrap the application.
*

View File

@@ -13,11 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.users;
package example.springdata.web.users;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import example.springdata.web.users.Password;
import example.springdata.web.users.User;
import example.springdata.web.users.UserManagement;
import example.springdata.web.users.Username;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

View File

@@ -13,7 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.users;
package example.springdata.web.users;
import example.springdata.web.users.Password;
import example.springdata.web.users.User;
import example.springdata.web.users.UserRepository;
import example.springdata.web.users.Username;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;