chore: update

This commit is contained in:
TakahashiNg
2026-05-15 00:12:03 +00:00
parent 4b3662ba1f
commit 25d10e6a9c
2 changed files with 5 additions and 2 deletions
@@ -19,7 +19,7 @@ public class ReviewEntity extends BaseEntity implements ReviewInterface {
public UUID reviewerId;
@ManyToOne(fetch = FetchType.EAGER)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "eateryId")
public EateryEntity eatery;
@@ -5,6 +5,7 @@ import com.drinkool.Role;
import com.drinkool.Url;
import com.drinkool.dtos.DtoMapper;
import com.drinkool.dtos.SendReview;
import com.drinkool.entities.EateryEntity;
import com.drinkool.entities.ReviewEntity;
import com.drinkool.enums.SortBy;
import io.quarkus.panache.common.Sort;
@@ -44,8 +45,10 @@ public class ReviewService {
case LOWEST -> Sort.ascending("rating");
};
EateryEntity eatery = EateryEntity.findById(eateryId);
return Response.ok()
.entity(ReviewEntity.find("eatery.id = ?1", sort, eateryId).list())
.entity(ReviewEntity.find("eatery = ?1", sort, eatery).list())
.build();
}