File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Object Relational Mapping
Current Row Index for Bulk Updates
Joined: Aug 03, 2008
Jun 06, 2009 01:48:30
Hello, I'm not sure whether this was the correct forum for this question or ORM forum so I posted it here. I have a table with this structure
Now I want to run a bulk update command to set the rank based on the points and join date. So I want to run a query like this
update user_table set rank = |row index| order by points DESC, join date
Now what I don't know is how to represent this |row index| in the query. Is there any solution in JPQL?? Or is there any native query for this. I'm using MySQL 5.0.
SCJP 6 | SCWCD 5 |
Javaranch SCJP FAQ
Joined: May 26, 2003
Jun 06, 2009 07:19:57
It's the ORM forum. I'll move it.
How To Ask Questions The Smart Way
Blogging on Certs:
SCEA Part 1
Part 2 & 3
Core Spring 3
TOGAF part 1
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: Current Row Index for Bulk Updates
SQL Help Please
How to specify a conditional new value in JPA bulk update
Update Table Nested Query (Using Function)
Hibernate Criteria with a one-to-many association
Bulk updates vs Sql query to update bulk records in Hibernate
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013