Skip to content

Commit b53be3f

Browse files
committed
feat(SoundFileSourceRepository): add method to retrieve sound file sources by sound event ID
1 parent 0b7e629 commit b53be3f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/net/onelitefeather/vulpes/api/repository/SoundFileSourceRepository.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package net.onelitefeather.vulpes.api.repository;
22

3+
import io.micronaut.data.annotation.Query;
34
import io.micronaut.data.annotation.Repository;
45
import io.micronaut.data.repository.PageableRepository;
56
import net.onelitefeather.vulpes.api.model.sound.SoundFileSource;
67

8+
import java.util.List;
79
import java.util.UUID;
810

911
/**
@@ -15,4 +17,14 @@
1517
*/
1618
@Repository
1719
public interface SoundFileSourceRepository extends PageableRepository<SoundFileSource, UUID> {
20+
21+
/**
22+
* Retrieves the sound file sources associated with a sound event by its ID.
23+
*
24+
* @param id the unique identifier of the sound event
25+
* @return a list of sound file sources associated with the sound event
26+
*/
27+
@Query("SELECT f FROM sound_data f WHERE f.soundEvent.id = :id")
28+
List<SoundFileSource> findSoundFileSourcesBySoundEvent(UUID id);
29+
1830
}

0 commit comments

Comments
 (0)