add methods to repository
package greencity.repository;
import greencity.entity.Photo;
+import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@@ -9,4 +10,5 @@ import org.springframework.stereotype.Repository;
*/
@Repository
public interface PhotoRepo extends JpaRepository<Photo, Long> {
+ Optional<Photo> findByName(String name);
}
