aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1705362 - in /aries/trunk/jpa/examples/tasklist-blueprint/src: main/java/org/apache/aries/jpa/example/tasklist/blueprint/impl/ test/java/org/apache/aries/jpa/example/ test/java/org/apache/aries/jpa/example/tasklist/ test/java/org/apache/ar...
Date Fri, 25 Sep 2015 22:05:43 GMT
Author: cschneider
Date: Fri Sep 25 22:05:42 2015
New Revision: 1705362

URL: http://svn.apache.org/viewvc?rev=1705362&view=rev
Log:
Some fixed in examples

Added:
    aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/example/
    aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/example/tasklist/
    aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/example/tasklist/blueprint/
    aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/example/tasklist/blueprint/impl/
    aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/example/tasklist/blueprint/impl/TaskServiceImplTest.java
      - copied, changed from r1705334, aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/tasklist/blueprint/impl/TaskServiceImplTest.java
Removed:
    aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/tasklist/blueprint/impl/TaskServiceImplTest.java
Modified:
    aries/trunk/jpa/examples/tasklist-blueprint/src/main/java/org/apache/aries/jpa/example/tasklist/blueprint/impl/TaskServiceImpl.java

Modified: aries/trunk/jpa/examples/tasklist-blueprint/src/main/java/org/apache/aries/jpa/example/tasklist/blueprint/impl/TaskServiceImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/examples/tasklist-blueprint/src/main/java/org/apache/aries/jpa/example/tasklist/blueprint/impl/TaskServiceImpl.java?rev=1705362&r1=1705361&r2=1705362&view=diff
==============================================================================
--- aries/trunk/jpa/examples/tasklist-blueprint/src/main/java/org/apache/aries/jpa/example/tasklist/blueprint/impl/TaskServiceImpl.java
(original)
+++ aries/trunk/jpa/examples/tasklist-blueprint/src/main/java/org/apache/aries/jpa/example/tasklist/blueprint/impl/TaskServiceImpl.java
Fri Sep 25 22:05:42 2015
@@ -22,45 +22,40 @@ import java.util.Collection;
 
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
+import javax.transaction.Transactional;
+import javax.transaction.Transactional.TxType;
 
 import org.apache.aries.jpa.example.tasklist.model.Task;
 import org.apache.aries.jpa.example.tasklist.model.TaskService;
-import org.apache.aries.transaction.annotations.Transaction;
 
+@Transactional
 public class TaskServiceImpl implements TaskService {
 
     @PersistenceContext(unitName = "tasklist")
     EntityManager em;
 
-    @Override
+    @Transactional(TxType.SUPPORTS)
     public Task getTask(Integer id) {
         return em.find(Task.class, id);
     }
 
-    @Transaction
-    @Override
+    
     public void addTask(Task task) {
         em.persist(task);
         em.flush();
     }
 
+    @Transactional(TxType.SUPPORTS)
     public Collection<Task> getTasks() {
         return em.createQuery("select t from Task t", Task.class).getResultList();
     }
 
-    @Transaction
-    @Override
     public void updateTask(Task task) {
         em.persist(task);
     }
 
-    @Transaction
-    @Override
     public void deleteTask(Integer id) {
         em.remove(getTask(id));
     }
 
-    public void setEm(EntityManager em) {
-        this.em = em;
-    }
 }

Copied: aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/example/tasklist/blueprint/impl/TaskServiceImplTest.java
(from r1705334, aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/tasklist/blueprint/impl/TaskServiceImplTest.java)
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/example/tasklist/blueprint/impl/TaskServiceImplTest.java?p2=aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/example/tasklist/blueprint/impl/TaskServiceImplTest.java&p1=aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/tasklist/blueprint/impl/TaskServiceImplTest.java&r1=1705334&r2=1705362&rev=1705362&view=diff
==============================================================================
--- aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/tasklist/blueprint/impl/TaskServiceImplTest.java
(original)
+++ aries/trunk/jpa/examples/tasklist-blueprint/src/test/java/org/apache/aries/jpa/example/tasklist/blueprint/impl/TaskServiceImplTest.java
Fri Sep 25 22:05:42 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.aries.jpa.tasklist.blueprint.impl;
+package org.apache.aries.jpa.example.tasklist.blueprint.impl;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -38,7 +38,7 @@ public class TaskServiceImplTest {
         EntityManagerFactory emf = createTestEMF();
         final EntityManager em = emf.createEntityManager();
         em.getTransaction().begin();
-        taskServiceImpl.setEm(em);
+        taskServiceImpl.em = em;
 
         TaskService taskService = taskServiceImpl;
 



Mime
View raw message