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 ) {
}
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);
}
}