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:
@@ -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;
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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,
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user