fix: SQL statement returns object instead of row

This commit is contained in:
Alyx Gryczewski 2024-07-28 18:26:03 -04:00
parent a931f40b7c
commit 9934fd2688

View File

@ -11,7 +11,7 @@ import java.util.UUID;
@Repository @Repository
public interface OutfitRepository extends JpaRepository<Outfit, UUID> { public interface OutfitRepository extends JpaRepository<Outfit, UUID> {
@Query(value = "SELECT o FROM outfit o ORDER BY random() LIMIT 1", nativeQuery = true) @Query(value = "SELECT * FROM outfit ORDER BY random() LIMIT 1", nativeQuery = true)
Outfit findRandomOutfit(); Outfit findRandomOutfit();
@Query(value = "SELECT o FROM outfit o WHERE o.submitter = ?1", nativeQuery = true) @Query(value = "SELECT o FROM outfit o WHERE o.submitter = ?1", nativeQuery = true)