I use the HQL query data, but the HQL is wrong. I think Hibernate should throw an error. The following code: String sql = "from TestMainVO where code=:code and id=:id and (id>1 and id>2))and (2=2 and fint>90)"; Query query = session.createQuery(sql); query.setString("code", "A0"); query.setString("id", "00"); List list = query.list();
The console output:: INFO: HHH000230: Schema export complete Hibernate: select testmainvo0_.FID as FID1_0_, testmainvo0_.FCODE as FCODE2_0_, testmainvo0_.Ffint as Ffint3_0_, testmainvo0_.FFDOU as FFDOU4_0_, testmainvo0_.Fflong as Fflong5_0_, testmainvo0_.FAGE as FAGE6_0_, testmainvo0_.FBIGDECIMAL as FBIGDECI7_0_, testmainvo0_.FCREATOR_ID as FCREATOR8_0_, testmainvo0_.FCREATE_TIME as FCREATE_9_0_, testmainvo0_.FLAST_EDITOR_ID as FLAST_E10_0_, testmainvo0_.FLAST_EDIT_TIME as FLAST_E11_0_, testmainvo0_.FDELETE_USER_ID as FDELETE12_0_, testmainvo0_.FMARK_DELETE_TIME as FMARK_D13_0_, testmainvo0_.FDELETED as FDELETE14_0_, testmainvo0_.FCHECKED as FCHECKE15_0_, testmainvo0_.FCHECKER_ID as FCHECKE16_0_, testmainvo0_.FCHECK_TIME as FCHECK_17_0_, testmainvo0_.FOTHER_CHECKER_IDS as FOTHER_18_0_, testmainvo0_.FOTHER_CHECK_TIMES as FOTHER_19_0_, testmainvo0_.FOTHER_CHECK_STATES as FOTHER_20_0_, testmainvo0_.FSTART_TIME as FSTART_21_0_, testmainvo0_.FEND_TIME as FEND_TI22_0_ from T_TestMain testmainvo0_ where testmainvo0_.FCODE=? and testmainvo0_.FID=? and testmainvo0_.FID>1 and testmainvo0_.FID>2
Obviously, the result is wrong!
|