@Query不返回任何结果

问题描述:

我在存储库类中使用Spring Data JPA的@Query注释。当我在PL-SQL开发者中运行相同的SQL时,它返回结果,但不在应用程序内部。问题是什么 ?我如何解决它?请帮助。 在此先感谢@Query不返回任何结果

我的回购类:

@Repository 
public interface FiberChannelRepository extends FndJpaRepositiry<FiberChannel, Long> { 

    @Query("select n.id, c.id, loc from FiberChannel fc left join Channel c on fc.id=c.id left join ChannelNode cn on c.id = cn.id and cn.deleted != true left join Node n on cn.id = n.id and cn.deleted != true left join Location loc on loc.id = n.id and cn.deleted != true where fc.id=?1") 
    List<Object[]> findNodesByFiber_Id(Long idFiber); 

} 

SQL变种:

select n.id_node, c.id_channel, loc.* 
    from Fiber_Channel fc 
     left join channel c on fc.id_channel=c.id_channel 
    left join CHANNEL_NODE cn 
     on c.id_channel = cn.id_channel and cn.is_deleted != 1 
    left join Node n 
     on cn.id_node = n.id_node and cn.is_deleted != 1 
    left join Location loc 
     on loc.id_location = n.id_location and cn.is_deleted != 1 where 
fc.id_fiber=42266 

我解决我的问题。我在查询sql中犯了错误。我用fc.fiber.id替换fc.id,它现在可以工作。