help using getJpaTemplate( ) in chapter 3
Hi to all,
In Implementing the Album Repository Dao section (page 90 in the book) i want to use Spring's jpaDaoSupport class. I wrote the AlbumJpaRepository extending with JpaDaoSupport and rewrite methods with getJpaTemplate(). I wonder how to rewrite the removePictureFromAlbum(Integer id) method with getJpaTemplate().?
@Transactional
public void removePictureFromAlbum(Integer id) {
Query q = entityManager.createNamedQuery("deletePicture");
q.setParameter(1, id);
q.executeUpdate();
}
|