Author: amarkhel
Date: 2009-03-25 13:40:09 -0400 (Wed, 25 Mar 2009)
New Revision: 13194
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
Log:
Fix some bugs
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
===================================================================
---
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2009-03-25
17:39:24 UTC (rev 13193)
+++
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2009-03-25
17:40:09 UTC (rev 13194)
@@ -104,7 +104,7 @@
inverseJoinColumns =
@JoinColumn(name = "CI_METATAG_ID",
referencedColumnName = "METATAG_ID"))
- protected List<MetaTag> imageTags;
+ protected List<MetaTag> imageTags = new ArrayList<MetaTag>();
/*
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java
===================================================================
---
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2009-03-25
17:39:24 UTC (rev 13193)
+++
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2009-03-25
17:40:09 UTC (rev 13194)
@@ -303,25 +303,4 @@
}
return images;
}
-
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- User user = (User) o;
-
- if (email != null ? !email.equals(user.email) : user.email != null) return
false;
- if (id != null ? !id.equals(user.id) : user.id != null) return false;
- if (login != null ? !login.equals(user.login) : user.login != null) return
false;
-
- return true;
- }
-
- public int hashCode() {
- int result;
- result = (id != null ? id.hashCode() : 0);
- result = 31 * result + (email != null ? email.hashCode() : 0);
- result = 31 * result + (login != null ? login.hashCode() : 0);
- return result;
- }
}
\ No newline at end of file
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
===================================================================
---
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java 2009-03-25
17:39:24 UTC (rev 13193)
+++
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java 2009-03-25
17:40:09 UTC (rev 13194)
@@ -58,6 +58,8 @@
public void deleteAlbum(Album album, boolean isFlushNeeded){
if(album.getShelf()!=null){
album.getShelf().removeChildAlbum(album);
+ album.getShelf().setCountUnvisitedImages(null);
+ album.getShelf().setUnvisitedImages(null);
}else{
user.removeAlbum(album);
}
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
===================================================================
---
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2009-03-25
17:39:24 UTC (rev 13193)
+++
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2009-03-25
17:40:09 UTC (rev 13194)
@@ -45,6 +45,9 @@
EntityManager em;
public void deleteImage(Image image, boolean isFlushNeeded) {
+ if(image.getAlbum().getCoveringImage().equals(image)){
+ image.getAlbum().setCoveringImage(null);
+ }
image.getAlbum().removeImage(image);
if (isFlushNeeded) {
em.flush();
Show replies by date