HQL multiple updates. Is there a better way?
Posted
by folone
on Stack Overflow
See other posts from Stack Overflow
or by folone
Published on 2010-03-16T09:42:11Z
Indexed on
2010/03/16
9:46 UTC
Read the original article
Hit count: 264
I have a Map, that I want to persist. The domain object is something like this:
public class Settings {
private String key;
private String value;
public String getKey() { ... }
public String getValue() { ... }
public void setKey() { ... }
public void setValue() { ... }
}
The standard approach is to generate a Setting
for each pair, and saveOrUpdate()
it. But it generates way too much queries, because I need to save lots of settings at a time, and it really affects perfomance. Is there a way to do this using one update query?
© Stack Overflow or respective owner