new Object[] { watchList.getXid(), userId, watchList.getName() }));
return watchList;
}
public void saveWatchList(final WatchList watchList) {
final ExtendedJdbcTemplate ejt2 = ejt;
getTransactionTemplate().execute(new TransactionCallbackWithoutResult() {
@SuppressWarnings("synthetic-access")
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
if (watchList.getId() == Common.NEW_ID)
watchList.setId(doInsert("insert into watchLists (xid, name, userId) values (?,?,?)", new Object[] {
watchList.getXid(), watchList.getName(), watchList.getUserId() }));
else
ejt2.update("update watchLists set xid=?, name=? where id=?", new Object[] { watchList.getXid(),
watchList.getName(), watchList.getId() });
ejt2.update("delete from watchListPoints where watchListId=?", new Object[] { watchList.getId() });
ejt2.batchUpdate("insert into watchListPoints values (?,?,?)", new BatchPreparedStatementSetter() {
@Override
public int getBatchSize() {
return watchList.getPointList().size();
}