Spring Boot JPA with parameter

By | 2022년 9월 7일
Table of Contents

Spring Boot JPA with parameter

as 를 붙여주어야 정상적으로 작동한다.

public interface ItemRepository  extends DefaultJpaRepository<ItemEntity, Long> {

    @Query("select e.id as id, e.fileId as fileId from ItemEntity e where e.id in :ids")
    List<IFileIdEntity> findByIdList(@Param("ids") Set<Long> ids);
}
public interface IFileIdEntity {

    Long getId();
    String getFileId();
}

답글 남기기