473,466 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to update the value of particular cell in table using HQL

11 New Member
Expand|Select|Wrap|Line Numbers
  1. public void saveSinglePercentage(String singlePassPercentage,
  2.             String userName) throws ApplicationException {
  3.  
  4.         int singlePercent = Integer.valueOf(singlePassPercentage);
  5.           String[] params = { PASS_SPERCENT,USER_ID_PARAM };
  6.          Object[] values = {singlePassPercentage};
  7.          System.out.println(singlePercent);
  8.          System.out.println(userName);
  9.          getHibernateTemplate().update("update TUserModule tuserMod  set tuserMod.passPercentage=:singlePercent where TUser.userName=:userName"); 
when i use this i have got this error "org.springframework.orm.hibernate3.HibernateSyste mException: Unknown entity: java.lang.String; nested exception is org.hibernate.MappingException: Unknown entity: java.lang.String " please help me, Thanks in advance.
Oct 9 '13 #1
6 2478
r035198x
13,262 MVP
What is TUser in your query?
Did you mean to write
Expand|Select|Wrap|Line Numbers
  1.  update TUserModule tuserMod  set tuserMod.passPercentage=:singlePercent where tuserMod.tUser.userName=:userName"
?
Oct 11 '13 #2
harithapriya
11 New Member
The UserId is present in Tuser class which have reference in tusermodule class
Oct 15 '13 #3
r035198x
13,262 MVP
You can't just start accessing it in the query without using the alias that you have created.
Oct 15 '13 #4
harithapriya
11 New Member
not only that any small query is not executed in that update method.can u please suggest me to use which method from hibernate template class?
Oct 15 '13 #5
r035198x
13,262 MVP
You should see the API specs for that class before using it. You are using a method that expects an entity and you are passing it a query instead. If you want to use that method then you should edit the values on your entity class and pass that entity to the method instead.
Oct 15 '13 #6
harithapriya
11 New Member
thanks so much !! I have used bulk update instead of update which take string and its working fine :)
Oct 15 '13 #7

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

Similar topics

1
by: Jimmy | last post by:
I have a table that is shown below in ORIGINAL TABLE. It is common for the VEHICLE # field to have repeating vehicles (ID 3,4,5 & 8,9). Usually the Vehicle will have SHIPDATE, DATE_RECEIVED, and...
17
by: Rico | last post by:
Hello, I am in the midst of converting an Access back end to SQL Server Express. The front end program (converted to Access 2003) uses DAO throughout. In Access, when I use recordset.AddNew I...
3
by: Manikandan | last post by:
Hi, I have table with three columns as below table name:exp No(int) name(char) refno(int) I have data as below No name refno 1 a 2 b 3 c
1
by: vdama | last post by:
Hi, I am using MS-Access as back end table for VB application. In the access table there are four columns as sno,productioncount ,percentage and totalcount. Here in prodcution count filed we have...
1
by: veer | last post by:
hi i am trying to access the mdb table value into strings but it transfer only one column value and on next colum it show error "item not found inthis collection" dbRec.MoveLast() ...
2
ranjana1980
by: ranjana1980 | last post by:
Hi All, I have two tables One is Student And another is AcademicQualification.In first table RegNo is primary key and in second one it is foreign key then how to create trigger to update table where...
1
by: rajujrk | last post by:
Hai All, I am new JBoss Seam, but i executes the Seam Application.. But now My Problem is to insert the values from JSF based registration from.. How to insert the values using seam? ...
1
by: Mena Williams | last post by:
I have an order table and an inventory table. I have a form with combo and text boxes to add new orders to order table. I want to be able to reduce the # of stock in inventory table by number of...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.