Skip to content

Commit a2ed380

Browse files
committed
feat(ItemRepository): add method to retrieve all items with enchantments, lore, and flags
1 parent 09a4248 commit a2ed380

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,13 @@ public interface ItemRepository extends PageableRepository<ItemEntity, UUID> {
4545
*/
4646
@Query("SELECT f FROM items i JOIN i.enchantments f WHERE i.id = :id")
4747
List<String> findFlagsById(UUID id);
48+
49+
50+
/**
51+
* Retrieves all items along with their associated enchantments, lore, and flags.
52+
*
53+
* @return a list of all ItemEntity objects with their enchantments, lore, and flags
54+
*/
55+
@Query("SELECT i FROM items i LEFT JOIN FETCH i.enchantments LEFT JOIN FETCH i.lore LEFT JOIN FETCH i.flags")
56+
List<ItemEntity> findAllWithFetches();
4857
}

0 commit comments

Comments
 (0)