I am using Spring data and jpaRepository for interacting with DB.
public interface TelevisionSourceRepository extends JpaRepository<MyTelevisionSource, Long> {
@Query("select new com.tivo.extract.config.dto.SourceListDTO(s.SourceId, s.SourceName, t.TvsourceLongName) from MyTelevisionSource t join fetch RCMSource s ON s.SourceId = t.SourceId")
List<SourceListDTO> findSourceList(Pageable pageable);
}
I want to keep the query in properties file and want to use those query.
I tried with
@PropertySource("classpath:/Query.properties")
@Value("${RCM.findSourceList}")
List<SourceListDTO> findSourceList(Pageable pageable);
but its not working, any other way is there