JPA没有返回列表

时间:2016-12-08 07:03:16

标签: hibernate jpa netbeans

我正在尝试从本机查询返回一个列表。 getResultList()永远不会返回。没有抛出异常,日志也没有显示任何内容。管理工作室中的相同查询在不到一秒的时间内执行。可能是什么问题?

        em.flush();
        em.clear();
        Query query = em.createNativeQuery(" select * from [CB_L700_File_Item] c with(nolock)\n"
                + " where L700_File_No = ? and isnull(RejectionError,'') <> '' ", CB_L700_FileItem.class);
        query.setParameter(1, fileNo);
        List<CB_L700_FileItem> rejectedLineItems = new ArrayList<>();

        rejectedLineItems = query.getResultList();

服务器输出显示传递的查询。但没有更多

08:40:35,861 INFO  [stdout] (default task-22) Hibernate: BULK INSERT [dbo].[CB_L700_File_Item] FROM 'D:\FILES\SACCRA_BCP_\0040812160835138439467202.csv' WITH (FIELDTERMINATOR='/|/', ROWTERMINATOR='~|~');

08:41:03,045 INFO  [stdout] (default task-22) Hibernate: {call sp_CB_L700_File_ApplyRules(?,?,?)}

08:44:34,797 INFO  [stdout] (default task-22) Hibernate: select cb_l700_fi0_.L700_File_Status_No as L1_17_, cb_l700_fi0_.L700_File_Status as L2_17_, cb_l700_fi0_.System_Date as System_D3_17_, cb_l700_fi0_.System_Org_No as System_O4_17_, cb_l700_fi0_.System_User_No as System_U5_17_, cb_l700_fi0_.Touch_Date as Touch_Da6_17_, cb_l700_fi0_.Touch_Org_No as Touch_Or7_17_, cb_l700_fi0_.Touch_User_No as Touch_Us8_17_ from CB_L700_File_Status cb_l700_fi0_ where cb_l700_fi0_.L700_File_Status=?

08:44:34,829 INFO  [stdout] (default task-22) Hibernate: select cb_l700_fi0_.L700_File_Status_No as L1_17_, cb_l700_fi0_.L700_File_Status as L2_17_, cb_l700_fi0_.System_Date as System_D3_17_, cb_l700_fi0_.System_Org_No as System_O4_17_, cb_l700_fi0_.System_User_No as System_U5_17_, cb_l700_fi0_.Touch_Date as Touch_Da6_17_, cb_l700_fi0_.Touch_Org_No as Touch_Or7_17_, cb_l700_fi0_.Touch_User_No as Touch_Us8_17_ from CB_L700_File_Status cb_l700_fi0_ where cb_l700_fi0_.L700_File_Status=?

08:44:35,239 INFO  [stdout] (default task-50) Hibernate: {call sp_CB_L700_SummaryReport(?)}

08:45:36,974 INFO  [stdout] (default task-50) Hibernate:  select * from [CB_L700_File_Item] c with(nolock)
08:45:36,977 INFO  [stdout] (default task-50)  where L700_File_No = ? and isnull(RejectionError,'') <> '' 

0 个答案:

没有答案