diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-04-20 17:29:18 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-04-20 17:31:02 +0200 |
commit | a03d5154456587fc7920e632f083cc5f1e4318a9 (patch) | |
tree | 08cddc03fc61aae0cfd4deb08bd8f99aca19bd40 /src/main/java/io/trygvis/UpdateArticleCallable.java | |
parent | 637dddf11f5d60b35c9696914e1e2658b2ddc611 (diff) | |
download | quartz-based-queue-a03d5154456587fc7920e632f083cc5f1e4318a9.tar.gz quartz-based-queue-a03d5154456587fc7920e632f083cc5f1e4318a9.tar.bz2 quartz-based-queue-a03d5154456587fc7920e632f083cc5f1e4318a9.tar.xz quartz-based-queue-a03d5154456587fc7920e632f083cc5f1e4318a9.zip |
wip
Diffstat (limited to 'src/main/java/io/trygvis/UpdateArticleCallable.java')
-rwxr-xr-x | src/main/java/io/trygvis/UpdateArticleCallable.java | 26 |
1 files changed, 13 insertions, 13 deletions
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<String> arguments) throws Exception { log.info("UpdateArticeJob.run: BEGIN"); Date now = new Date(); log.info("now = {}", now); +/* TypedQuery<Article> q = entityManager.createQuery(entityManager.getCriteriaBuilder().createQuery(Article.class)); List<Article> list = q.getResultList(); @@ -38,6 +37,7 @@ public class UpdateArticleCallable a.setUpdated(new Date()); entityManager.persist(a); +*/ log.info("UpdateArticeJob.run: END"); } |