-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: [Q&A] Update data for multi table in My SQL
PostPosted: Sun May 31, 2009 1:49 am 
Newbie

Joined: Sun May 31, 2009 1:34 am
Posts: 1
I am using Hibernate to execute data. I have 2 table as bellow.

TableA (
A1_Column,
A2_Column,
)

TableB (
A1_Column,
B1_Column,
)

I created sql query string as bellow:

strQuery = "UPDATE TableA as A, TableB as B
SET A.A2_Column = 'aaa', B.B1_Column = 'bbb'
WHERE A.A1_Column = B.A1_Column"

I executed query as bellow:

Session sess = getSession();
Query query = sess.createQuery(strQuery);
query.executeUpdate();

So, It not execute when I run my application. It have error message same to "Update queries not support in through HQL".

I tried to use createSQLQuery for that problem, So they are the same.

Please help me for that problem. Thanks a lot.

P/S: I am not English or American. So, my English is very bad. I can't description as clearly. (I am sorry for that problem).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.