Add transction
This commit is contained in:
@@ -65,7 +65,7 @@ public class Mindmap implements Serializable {
|
||||
@Column(name = "public")
|
||||
private boolean isPublic;
|
||||
|
||||
@OneToMany(mappedBy = "mindMap", orphanRemoval = true, cascade = {CascadeType.ALL}, fetch = FetchType.EAGER)
|
||||
@OneToMany(mappedBy = "mindMap", orphanRemoval = true, cascade = {CascadeType.ALL}, fetch = FetchType.LAZY)
|
||||
@Fetch(FetchMode.JOIN)
|
||||
private Set<Collaboration> collaborations = new HashSet<>();
|
||||
|
||||
|
@@ -36,6 +36,8 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -46,6 +48,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
import java.util.Locale;
|
||||
|
||||
@Controller
|
||||
@Transactional(propagation = Propagation.REQUIRED)
|
||||
public class MvcMindmapController {
|
||||
|
||||
@Qualifier("mindmapService")
|
||||
|
Reference in New Issue
Block a user