Wednesday, 15 February 2012

How to use 'OR' keyword in Hibernate HQL? -


Is the code given below correct? I want to retrieve a list of data files for the given data connection and if the datacodes are either 2 or 3.

  Public listing & lt; DataFileVO & gt; GetDataFileByDataNum (string data-new) {list & lt; DataFileVO & gt; Datafile List = New Arrestist & lt; Data file VO & gt; (); String query = "Select the data file from the datafile VO data file" + "where datafile.dataNum =?" + "And Data File Type Data Recovery = 2 or Two Data File. Type Data Recovery = 3"; DataFileList = this.getHibernateTemplate (). Search (query, data news); Returned datafile list;  

Change:

  and datafile.dataRetrievalTypeCode = 2 or by duadatafile.dataFileRetrievalTypeCode = 3  

By:

  and the data file. Data recovery type type (2,3)  

You are trying to do this Cheers!


No comments:

Post a Comment