mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-21 13:47:57 +01:00
Fix db error during account creation.
This commit is contained in:
parent
5f26874b47
commit
aa6ac9bf7f
@ -115,6 +115,7 @@ public class UserManagerImpl
|
||||
Collaboration newCollab = new Collaboration();
|
||||
newCollab.setRoleId(oldCollab.getRole().ordinal());
|
||||
newCollab.setMindMap(oldCollab.getMindMap());
|
||||
oldCollab.getMindMap().removedCollaboration(oldCollab);
|
||||
newCollab.setCollaborator(user);
|
||||
user.addCollaboration(newCollab);
|
||||
newCollabs.add(newCollab);
|
||||
@ -124,7 +125,6 @@ public class UserManagerImpl
|
||||
final HibernateTemplate template = getHibernateTemplate();
|
||||
collaborations.forEach(c -> template.delete(c));
|
||||
template.delete(collaborator);
|
||||
template.flush();
|
||||
|
||||
// Save all new...
|
||||
this.createUser(user);
|
||||
|
@ -21,6 +21,7 @@ package com.wisemapping.model;
|
||||
|
||||
import org.hibernate.annotations.Fetch;
|
||||
import org.hibernate.annotations.FetchMode;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
@ -46,7 +47,7 @@ public class Collaboration implements Serializable {
|
||||
private Collaborator collaborator;
|
||||
|
||||
@ManyToOne(cascade = CascadeType.ALL)
|
||||
@JoinColumn(name = "properties_id", nullable = false, unique = true)
|
||||
@JoinColumn(name = "properties_id", nullable = true, unique = true)
|
||||
private CollaborationProperties collaborationProperties = new CollaborationProperties();
|
||||
|
||||
public Collaboration() {
|
||||
@ -103,12 +104,13 @@ public class Collaboration implements Serializable {
|
||||
this.collaborator = collaborator;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@Nullable
|
||||
public CollaborationProperties getCollaborationProperties() {
|
||||
return this.collaborationProperties;
|
||||
}
|
||||
|
||||
public void setCollaborationProperties(@NotNull CollaborationProperties collaborationProperties) {
|
||||
public void setCollaborationProperties(@Nullable CollaborationProperties collaborationProperties) {
|
||||
this.collaborationProperties = collaborationProperties;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user