[DS-2763] Add much transience to make DSOs actually serializable

This commit is contained in:
Mark H. Wood
2015-11-13 16:02:09 -05:00
parent ebf09a0d2e
commit 6d2e3b3ea3
10 changed files with 36 additions and 31 deletions

View File

@@ -33,7 +33,7 @@ import java.util.*;
public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
{
/** log4j category */
private static Logger log = Logger.getLogger(Community.class);
private static final Logger log = Logger.getLogger(Community.class);
@Column(name="community_id", insertable = false, updatable = false)
private Integer legacyId;
@@ -44,13 +44,13 @@ public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
joinColumns = {@JoinColumn(name = "parent_comm_id") },
inverseJoinColumns = {@JoinColumn(name = "child_comm_id") }
)
private List<Community> subCommunities = new ArrayList<>();
private final List<Community> subCommunities = new ArrayList<>();
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "subCommunities")
private List<Community> parentCommunities = new ArrayList<>();
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "communities", cascade = {CascadeType.PERSIST})
private List<Collection> collections = new ArrayList<>();
private final List<Collection> collections = new ArrayList<>();
@OneToOne
@JoinColumn(name = "admin")
@@ -69,7 +69,7 @@ public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
public static final String SIDEBAR_TEXT = "side_bar_text";
@Transient
protected CommunityService communityService;
protected transient CommunityService communityService;
protected Community() {
}
@@ -207,6 +207,7 @@ public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
return true;
}
@Override
public int hashCode()
{
return new HashCodeBuilder().append(getID()).toHashCode();