473,385 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

convert sql into hql : I have written the code whch includes sql queries but i neeed

I have written the code whch includes sql queries but i neeed to convert into hql how should i do....

the sql query is :

Expand|Select|Wrap|Line Numbers
  1. String sqlListSurveys= "select distinct s.surveyAutoID, s.surveyTitle, date(s.modifiedOn) modifiedOn, s.createdOn, "
  2.                 + "( CASE s.surveyState WHEN '0' THEN 'Created' WHEN '1' THEN 'Published' "
  3.                 + " ELSE 'UnPublished' END ) surveyState, s.createdby createdby, (select ifnull(max(respondentID),0) FROM response, survey sur where surveyID = sur.surveyAutoID and sur.surveyAutoID=s.surveyAutoID) respondentID "
  4.                 + " from survey s left outer join  response r  on r.surveyID = s.surveyAutoID "
  5.                 + " where createdby = "+userId+" and surveyState != '"+SGSConstants.DELETE_STATE+"' order by createdOn DESC";
  6.  
  7.  
  8.          logger.info(sqlListSurveys);
  9.  
  10.          Query queryListSurveys  = sessionFactory.getCurrentSession().createSQLQuery(sqlListSurveys).setParameter("surveyList",result);
  11.          queryListSurveys .setResultTransformer(Transformers.aliasToBean(Survey.class));
  12.          result = queryListSurveys .list();
  13.          map.put("surveyList", result);
Dec 10 '14 #1
0 1007

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: NeilAnderson | last post by:
I'm a fairly new user of access & I've never had any training, so I'm wondering if I'm doing the right thing here, or if it matter at all. I'm building a database for room booking purposes and I'm...
3
by: Luqman | last post by:
How to convert VB.Net code to ASP.Net ? Is it possible or is there any tool for that ? Best Regards, Luqman
6
by: Howard | last post by:
Just curious What is the largest program you have written in terms of source code length and complexity? Howard
1
by: priyakollu | last post by:
i have developed code in jsp but the problem is i need to convert this to asp.........pleasehelp me regarding this im sending code which i've developed....with file names.......... code.jsp <%@...
6
by: vbdog | last post by:
Hi I am trying to convert the vb6 code below into vb.net code can anyboddy help The vb6 code is from a chip8 Emulator that somboddy wrote. vb6 code this function keeps getting called until the...
5
by: nguyenlh | last post by:
I hava ( application web in asp ) fowllowing : I want load - Default2.aspx and Default3.aspx - I use a treeview but when there is a error - ex: Default2.aspx not inherite ...
4
by: meyousikmann | last post by:
I am working on an implementation of the Longest Common Subsequence problem (as I understand it, this problem can be used in spell checking type activities) and have used this site to understand...
1
by: sebasC | last post by:
the code below is used on a site to show time in multiple time zones on the website what i need is to convert the php code below to asp so that it will work. because the clock shows on the site but...
2
by: jayachandramuni | last post by:
Hi Buddy. Good day. i am jaya chandra muni ,i have few excel file with VBA code to achive some functionalty. that was written around few year back 1999. Now i want to convert those VBA code to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.