Author: amarkhel
Date: 2008-12-01 12:08:05 -0500 (Mon, 01 Dec 2008)
New Revision: 11466
Modified:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
Log:
Modified:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
===================================================================
---
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-12-01
16:57:16 UTC (rev 11465)
+++
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-12-01
17:08:05 UTC (rev 11466)
@@ -66,8 +66,10 @@
public void editImage(Image image, boolean parentChanged) {
em.merge(image);
if(parentChanged){
+ String login = image.getAlbum().getOwner().getLogin();
+ String albumName = image.getAlbumName();
image.getAlbum().removeImage(image);
- Album album = (Album)em.createQuery("from Album a where a.name=:albumName and
a.owner=:owner").setParameter("albumName",
image.getAlbumName()).setParameter("owner",
image.getAlbum().getOwner()).getSingleResult();
+ Album album = (Album)em.createQuery("from Album a where a.name=:albumName and
a.owner.name=:login").setParameter("albumName",
albumName).setParameter("owner", login).getSingleResult();
album.addImage(image);
em.merge(album);
}
Show replies by date