#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

@@ -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"));