(no commit message)
[utils] / mythtv / monitor / src / main / java / org / wamblee / mythtv / RecordingDatabase.java
index e4badfba898e40f01857b15d5ef86a8fdec18112..cbcf89d20caf4924fb176e2519d56c2ad1d5739f 100644 (file)
@@ -58,7 +58,7 @@ public class RecordingDatabase extends JpaDaoSupport {
         JpaTemplate jpaTemplate = getJpaTemplate();
         EntityManager entityManager = jpaTemplate.getEntityManager();
         Query query = entityManager.createQuery(
-                "from org.wamblee.mythtv.Recording where basename = ?1");
+                "select r from Recording r where r.basename = ?1");
         query.setParameter(1, aName);
         List<Recording> result = query.getResultList();
         if ( result.size() > 1 ) { 
@@ -71,8 +71,6 @@ public class RecordingDatabase extends JpaDaoSupport {
     }
     
     public void update(Recording aRecording) { 
-        // Update is not required since the whole task of updating the 
-        // directory structure occurs within a single transaction. 
-        // Therefore, modifications to recordings are automatically persisted. 
+        getJpaTemplate().getEntityManager().merge(aRecording);
     }
 }