From a03d5154456587fc7920e632f083cc5f1e4318a9 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 20 Apr 2013 17:29:18 +0200 Subject: wip --- .../java/io/trygvis/UpdateArticleCallable.java | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/main/java/io/trygvis/UpdateArticleCallable.java') diff --git a/src/main/java/io/trygvis/UpdateArticleCallable.java b/src/main/java/io/trygvis/UpdateArticleCallable.java index 7ed8b63..f1ea0e2 100755 --- a/src/main/java/io/trygvis/UpdateArticleCallable.java +++ b/src/main/java/io/trygvis/UpdateArticleCallable.java @@ -1,34 +1,33 @@ package io.trygvis; -import io.trygvis.model.*; -import io.trygvis.queue.*; -import org.slf4j.*; -import org.springframework.stereotype.*; -import org.springframework.transaction.annotation.*; +import io.trygvis.queue.AsyncService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; -import java.util.*; -import javax.persistence.*; +import java.util.Date; +import java.util.List; +import java.util.Random; -import static org.springframework.transaction.annotation.Propagation.*; - -@Component +@Component("updateArticle") public class UpdateArticleCallable implements AsyncService.AsyncCallable { private final Logger log = LoggerFactory.getLogger(getClass()); private final Random r = new Random(); - @PersistenceContext - private EntityManager entityManager; +// @PersistenceContext +// private EntityManager entityManager; // @Transactional(propagation = REQUIRES_NEW) - public void run() throws Exception { + public void run(List arguments) throws Exception { log.info("UpdateArticeJob.run: BEGIN"); Date now = new Date(); log.info("now = {}", now); +/* TypedQuery
q = entityManager.createQuery(entityManager.getCriteriaBuilder().createQuery(Article.class)); List
list = q.getResultList(); @@ -38,6 +37,7 @@ public class UpdateArticleCallable a.setUpdated(new Date()); entityManager.persist(a); +*/ log.info("UpdateArticeJob.run: END"); } -- cgit v1.2.3