Remove long package names from samples

Long package names are really unnecessary in samples and they
just clutter things up. Also Spring Loaded doesn't work with
org.sfw packages, so to demo that technology you need a
different package name.
This commit is contained in:
Dave Syer
2013-12-31 08:40:21 +00:00
parent 3c7361fb3e
commit f448e79f29
124 changed files with 223 additions and 222 deletions

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.sample.data.jpa;
package sample.data.jpa;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;

View File

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

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.sample.data.jpa.domain;
package 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.boot.sample.data.jpa.domain;
package 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.boot.sample.data.jpa.domain;
package 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.boot.sample.data.jpa.domain;
package sample.data.jpa.domain;
import java.io.Serializable;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.sample.data.jpa.domain;
package 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.boot.sample.data.jpa.domain;
package 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.boot.sample.data.jpa.domain;
package sample.data.jpa.domain;
public enum TripType {
BUSINESS, COUPLES, FAMILY, FRIENDS, SOLO

View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/
package org.springframework.boot.sample.data.jpa.service;
package sample.data.jpa.service;
import org.springframework.boot.sample.data.jpa.domain.City;
import sample.data.jpa.domain.City;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.Repository;

View File

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

View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/
package org.springframework.boot.sample.data.jpa.service;
package sample.data.jpa.service;
import org.springframework.boot.sample.data.jpa.domain.City;
import org.springframework.boot.sample.data.jpa.domain.HotelSummary;
import sample.data.jpa.domain.City;
import sample.data.jpa.domain.HotelSummary;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

View File

@@ -14,11 +14,11 @@
* limitations under the License.
*/
package org.springframework.boot.sample.data.jpa.service;
package sample.data.jpa.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.sample.data.jpa.domain.City;
import org.springframework.boot.sample.data.jpa.domain.HotelSummary;
import sample.data.jpa.domain.City;
import sample.data.jpa.domain.HotelSummary;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;

View File

@@ -14,28 +14,29 @@
* limitations under the License.
*/
package org.springframework.boot.sample.data.jpa.service;
package sample.data.jpa.service;
import java.util.List;
import org.springframework.boot.sample.data.jpa.domain.City;
import org.springframework.boot.sample.data.jpa.domain.Hotel;
import org.springframework.boot.sample.data.jpa.domain.HotelSummary;
import org.springframework.boot.sample.data.jpa.domain.RatingCount;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;
import sample.data.jpa.domain.City;
import sample.data.jpa.domain.Hotel;
import sample.data.jpa.domain.HotelSummary;
import sample.data.jpa.domain.RatingCount;
interface HotelRepository extends Repository<Hotel, Long> {
Hotel findByCityAndName(City city, String name);
@Query("select new org.springframework.boot.sample.data.jpa.domain.HotelSummary(h.city, h.name, avg(r.rating)) "
@Query("select new sample.data.jpa.domain.HotelSummary(h.city, h.name, avg(r.rating)) "
+ "from Hotel h left outer join h.reviews r where h.city = ?1 group by h")
Page<HotelSummary> findByCity(City city, Pageable pageable);
@Query("select new org.springframework.boot.sample.data.jpa.domain.RatingCount(r.rating, count(r)) "
@Query("select new sample.data.jpa.domain.RatingCount(r.rating, count(r)) "
+ "from Review r where r.hotel = ?1 group by r.rating order by r.rating DESC")
List<RatingCount> findRatingCounts(Hotel hotel);
}

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.boot.sample.data.jpa.service;
package sample.data.jpa.service;
import org.springframework.boot.sample.data.jpa.domain.City;
import org.springframework.boot.sample.data.jpa.domain.Hotel;
import org.springframework.boot.sample.data.jpa.domain.Review;
import org.springframework.boot.sample.data.jpa.domain.ReviewDetails;
import sample.data.jpa.domain.City;
import sample.data.jpa.domain.Hotel;
import sample.data.jpa.domain.Review;
import sample.data.jpa.domain.ReviewDetails;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

View File

@@ -14,19 +14,19 @@
* limitations under the License.
*/
package org.springframework.boot.sample.data.jpa.service;
package sample.data.jpa.service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.sample.data.jpa.domain.City;
import org.springframework.boot.sample.data.jpa.domain.Hotel;
import org.springframework.boot.sample.data.jpa.domain.Rating;
import org.springframework.boot.sample.data.jpa.domain.RatingCount;
import org.springframework.boot.sample.data.jpa.domain.Review;
import org.springframework.boot.sample.data.jpa.domain.ReviewDetails;
import sample.data.jpa.domain.City;
import sample.data.jpa.domain.Hotel;
import sample.data.jpa.domain.Rating;
import sample.data.jpa.domain.RatingCount;
import sample.data.jpa.domain.Review;
import sample.data.jpa.domain.ReviewDetails;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Component;

View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/
package org.springframework.boot.sample.data.jpa.service;
package sample.data.jpa.service;
import org.springframework.boot.sample.data.jpa.domain.Hotel;
import org.springframework.boot.sample.data.jpa.domain.Review;
import sample.data.jpa.domain.Hotel;
import sample.data.jpa.domain.Review;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.Repository;

View File

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

View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/
package org.springframework.boot.sample.data.jpa.web;
package sample.data.jpa.web;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.sample.data.jpa.service.CityService;
import sample.data.jpa.service.CityService;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;