mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 06:07:57 +01:00
Fix bug on non-existing last modified
This commit is contained in:
parent
aa6531efe1
commit
820e268e3e
@ -22,6 +22,8 @@ import com.wisemapping.exceptions.AccessDeniedSecurityException;
|
|||||||
import com.wisemapping.exceptions.WiseMappingException;
|
import com.wisemapping.exceptions.WiseMappingException;
|
||||||
import com.wisemapping.util.ZipUtils;
|
import com.wisemapping.util.ZipUtils;
|
||||||
import org.apache.commons.lang.StringEscapeUtils;
|
import org.apache.commons.lang.StringEscapeUtils;
|
||||||
|
import org.hibernate.annotations.NotFound;
|
||||||
|
import org.hibernate.annotations.NotFoundAction;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@ -34,7 +36,7 @@ import java.util.*;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MINDMAP")
|
@Table(name = "MINDMAP")
|
||||||
public class Mindmap implements Serializable {
|
public class Mindmap implements Serializable {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
@ -52,6 +54,7 @@ public class Mindmap implements Serializable {
|
|||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "last_editor_id", nullable = false)
|
@JoinColumn(name = "last_editor_id", nullable = false)
|
||||||
|
@NotFound(action = NotFoundAction.IGNORE)
|
||||||
private User lastEditor;
|
private User lastEditor;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
@ -59,7 +62,7 @@ public class Mindmap implements Serializable {
|
|||||||
@Column(name = "public")
|
@Column(name = "public")
|
||||||
private boolean isPublic;
|
private boolean isPublic;
|
||||||
|
|
||||||
@OneToMany(mappedBy="mindMap",orphanRemoval = true, cascade = {CascadeType.ALL})
|
@OneToMany(mappedBy = "mindMap", orphanRemoval = true, cascade = {CascadeType.ALL})
|
||||||
private Set<Collaboration> collaborations = new HashSet<>();
|
private Set<Collaboration> collaborations = new HashSet<>();
|
||||||
|
|
||||||
@ManyToMany(cascade = CascadeType.ALL)
|
@ManyToMany(cascade = CascadeType.ALL)
|
||||||
@ -155,7 +158,7 @@ public class Mindmap implements Serializable {
|
|||||||
public Optional<Collaboration> findCollaboration(@NotNull Collaborator collaborator) {
|
public Optional<Collaboration> findCollaboration(@NotNull Collaborator collaborator) {
|
||||||
return this.collaborations
|
return this.collaborations
|
||||||
.stream()
|
.stream()
|
||||||
.filter(c->c.getCollaborator().identityEquality(collaborator))
|
.filter(c -> c.getCollaborator().identityEquality(collaborator))
|
||||||
.findAny();
|
.findAny();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user