package com.alterdekim.game.repository;

import com.alterdekim.game.entity.LocationObjectInstance;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface LocationObjectInstanceRepository extends JpaRepository<LocationObjectInstance, Long> {
    @Query(value = "SELECT o FROM LocationObjectInstance o WHERE o.locationId = :locationId")
    List<LocationObjectInstance> findObjectsForLocationById(@Param("locationId") Long locationId);
}
