Remove FIXME from JPA sample
This commit is contained in:
@@ -19,8 +19,6 @@ package org.springframework.boot.sample.data.jpa.domain;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
//FIXME Hibernate bug HHH-5792 prevents this being embedded
|
||||
|
||||
public class ReviewDetails implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -38,12 +36,6 @@ public class ReviewDetails implements Serializable {
|
||||
public ReviewDetails() {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public ReviewDetails(String title, Rating rating) {
|
||||
this.title = title;
|
||||
this.rating = rating;
|
||||
}
|
||||
|
||||
public Rating getRating() {
|
||||
return this.rating;
|
||||
}
|
||||
|
||||
@@ -30,8 +30,6 @@ import org.springframework.util.StringUtils;
|
||||
@Transactional
|
||||
class CityServiceImpl implements CityService {
|
||||
|
||||
// FIXME deal with null repository return values
|
||||
|
||||
private final CityRepository cityRepository;
|
||||
|
||||
private final HotelRepository hotelRepository;
|
||||
|
||||
@@ -37,8 +37,6 @@ import org.springframework.util.Assert;
|
||||
@Transactional
|
||||
class HotelServiceImpl implements HotelService {
|
||||
|
||||
// FIXME deal with null repository return values
|
||||
|
||||
private final HotelRepository hotelRepository;
|
||||
|
||||
private final ReviewRepository reviewRepository;
|
||||
@@ -71,9 +69,8 @@ class HotelServiceImpl implements HotelService {
|
||||
|
||||
@Override
|
||||
public Review addReview(Hotel hotel, ReviewDetails details) {
|
||||
// FIXME
|
||||
System.out.println(details.getTitle());
|
||||
return new Review(hotel, 1, details);
|
||||
Review review = new Review(hotel, 1, details);
|
||||
return reviewRepository.save(review);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,5 +27,7 @@ interface ReviewRepository extends Repository<Review, Long> {
|
||||
Page<Review> findByHotel(Hotel hotel, Pageable pageable);
|
||||
|
||||
Review findByHotelAndIndex(Hotel hotel, int index);
|
||||
|
||||
Review save(Review review);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user