Fix some remaining issues from the Spring migration #20

Merged
niat8586 merged 14 commits from release-firefighting into develop 2024-11-20 12:56:22 +01:00
14 changed files with 37 additions and 2 deletions

View File

@ -65,6 +65,7 @@ import se.su.dsv.scipro.grading.NationalSubjectCategoryServiceImpl;
import se.su.dsv.scipro.grading.PublicationMetadataRepository; import se.su.dsv.scipro.grading.PublicationMetadataRepository;
import se.su.dsv.scipro.grading.PublicationMetadataServiceImpl; import se.su.dsv.scipro.grading.PublicationMetadataServiceImpl;
import se.su.dsv.scipro.grading.ThesisSubmissionHistoryService; import se.su.dsv.scipro.grading.ThesisSubmissionHistoryService;
import se.su.dsv.scipro.group.GroupFacadeImpl;
import se.su.dsv.scipro.group.GroupService; import se.su.dsv.scipro.group.GroupService;
import se.su.dsv.scipro.group.GroupServiceImpl; import se.su.dsv.scipro.group.GroupServiceImpl;
import se.su.dsv.scipro.integration.activityfinalseminar.ActivityFinalSeminarRepository; import se.su.dsv.scipro.integration.activityfinalseminar.ActivityFinalSeminarRepository;
@ -79,6 +80,7 @@ import se.su.dsv.scipro.match.ApplicationPeriodProjectTypeServiceImpl;
import se.su.dsv.scipro.match.ApplicationPeriodService; import se.su.dsv.scipro.match.ApplicationPeriodService;
import se.su.dsv.scipro.match.ApplicationPeriodServiceImpl; import se.su.dsv.scipro.match.ApplicationPeriodServiceImpl;
import se.su.dsv.scipro.match.FirstMeetingRepository; import se.su.dsv.scipro.match.FirstMeetingRepository;
import se.su.dsv.scipro.match.IdeaFacade;
import se.su.dsv.scipro.match.IdeaRepository; import se.su.dsv.scipro.match.IdeaRepository;
import se.su.dsv.scipro.match.IdeaService; import se.su.dsv.scipro.match.IdeaService;
import se.su.dsv.scipro.match.IdeaServiceImpl; import se.su.dsv.scipro.match.IdeaServiceImpl;
@ -1009,4 +1011,14 @@ public class CoreConfig {
public NotificationEventServiceImpl notificationEventService(NotificationEventRepository notificationEventRepository) { public NotificationEventServiceImpl notificationEventService(NotificationEventRepository notificationEventRepository) {
return new NotificationEventServiceImpl(notificationEventRepository); return new NotificationEventServiceImpl(notificationEventRepository);
} }
@Bean
public IdeaFacade ideaFacade() {
return new IdeaFacade();
}
@Bean
public GroupFacadeImpl groupFacade() {
return new GroupFacadeImpl();
}
} }

View File

@ -1,5 +1,6 @@
package se.su.dsv.scipro.finalseminar; package se.su.dsv.scipro.finalseminar;
import jakarta.transaction.Transactional;
import se.su.dsv.scipro.system.AbstractServiceImpl; import se.su.dsv.scipro.system.AbstractServiceImpl;
import se.su.dsv.scipro.system.User; import se.su.dsv.scipro.system.User;
@ -33,6 +34,7 @@ public class FinalSeminarRespondentServiceImpl extends AbstractServiceImpl<Final
} }
@Override @Override
@Transactional
public List<FinalSeminarRespondent> findOrCreate(FinalSeminar finalSeminar) { public List<FinalSeminarRespondent> findOrCreate(FinalSeminar finalSeminar) {
if(finalSeminar.getId() == null) { if(finalSeminar.getId() == null) {
return new ArrayList<>(); return new ArrayList<>();

View File

@ -56,6 +56,7 @@ public class FinalThesisServiceImpl extends AbstractServiceImpl<FinalThesis, Lon
} }
@Override @Override
@Transactional
public FinalThesis upload(ProjectFileUpload fileUpload, String englishTitle, String swedishTitle) { public FinalThesis upload(ProjectFileUpload fileUpload, String englishTitle, String swedishTitle) {
ProjectFile fileDescription = storeFinalThesisFile(fileUpload); ProjectFile fileDescription = storeFinalThesisFile(fileUpload);
final FileReference reference = fileService.createReference(fileDescription.getFileDescription()); final FileReference reference = fileService.createReference(fileDescription.getFileDescription());
@ -133,6 +134,7 @@ public class FinalThesisServiceImpl extends AbstractServiceImpl<FinalThesis, Lon
} }
@Override @Override
@Transactional
public void removeApproval(Project project) { public void removeApproval(Project project) {
setStatus(project, FinalThesis.Status.NO_DECISION); setStatus(project, FinalThesis.Status.NO_DECISION);
} }

View File

@ -1,5 +1,6 @@
package se.su.dsv.scipro.firstmeeting; package se.su.dsv.scipro.firstmeeting;
import jakarta.transaction.Transactional;
import se.su.dsv.scipro.activityplan.Activity; import se.su.dsv.scipro.activityplan.Activity;
import se.su.dsv.scipro.activityplan.ActivityPlanFacade; import se.su.dsv.scipro.activityplan.ActivityPlanFacade;
import se.su.dsv.scipro.project.Project; import se.su.dsv.scipro.project.Project;
@ -26,6 +27,7 @@ public class FirstMeetingServiceImpl extends AbstractServiceImpl<ProjectFirstMee
} }
@Override @Override
@Transactional
public ProjectFirstMeeting schedule(final Project project, final Date date, final String room, final String description) { public ProjectFirstMeeting schedule(final Project project, final Date date, final String room, final String description) {
final Optional<ProjectFirstMeeting> optFirstMeeting = findByProject(project); final Optional<ProjectFirstMeeting> optFirstMeeting = findByProject(project);
final ProjectFirstMeeting firstMeeting = optFirstMeeting final ProjectFirstMeeting firstMeeting = optFirstMeeting

View File

@ -358,7 +358,6 @@ public class IdeaServiceImpl extends AbstractServiceImpl<Idea, Long> implements
} }
} }
@Transactional
private Idea acceptIdea0(Idea idea, User creator, Program accepteeProgram, User coAuthor, final ApplicationPeriod applicationPeriod) { private Idea acceptIdea0(Idea idea, User creator, Program accepteeProgram, User coAuthor, final ApplicationPeriod applicationPeriod) {
Idea localIdea = idea; Idea localIdea = idea;
@ -442,6 +441,7 @@ public class IdeaServiceImpl extends AbstractServiceImpl<Idea, Long> implements
} }
@Override @Override
@Transactional
public void studentUnselect(final Idea idea, final User student) { public void studentUnselect(final Idea idea, final User student) {
unmatch(idea, student, new NotificationSource()); unmatch(idea, student, new NotificationSource());
} }
@ -490,7 +490,6 @@ public class IdeaServiceImpl extends AbstractServiceImpl<Idea, Long> implements
return returnValue; return returnValue;
} }
@Transactional
private Idea addMatch(User creator, User supervisor, Idea idea, NotificationSource notificationSource) { private Idea addMatch(User creator, User supervisor, Idea idea, NotificationSource notificationSource) {
Match match = new Match(); Match match = new Match();
match.setIdea(idea); match.setIdea(idea);

View File

@ -4,6 +4,7 @@ import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Predicate; import com.querydsl.core.types.Predicate;
import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.jpa.impl.JPAQuery; import com.querydsl.jpa.impl.JPAQuery;
import jakarta.transaction.Transactional;
import se.su.dsv.scipro.system.Pageable; import se.su.dsv.scipro.system.Pageable;
import se.su.dsv.scipro.milestones.dataobjects.Milestone; import se.su.dsv.scipro.milestones.dataobjects.Milestone;
import se.su.dsv.scipro.milestones.dataobjects.MilestoneActivityTemplate; import se.su.dsv.scipro.milestones.dataobjects.MilestoneActivityTemplate;
@ -54,6 +55,7 @@ public class MilestoneServiceImpl extends AbstractServiceImpl<Milestone, Long> i
} }
@Override @Override
@Transactional
public void setConfirmed(Project project, MilestoneActivityTemplate activity, boolean confirmed) { public void setConfirmed(Project project, MilestoneActivityTemplate activity, boolean confirmed) {
if (confirmed) { if (confirmed) {
for (MilestoneActivityTemplate earlierActivity : getEarlierIncompleteProjectMilestoneActivities(project, activity)) { for (MilestoneActivityTemplate earlierActivity : getEarlierIncompleteProjectMilestoneActivities(project, activity)) {
@ -84,6 +86,7 @@ public class MilestoneServiceImpl extends AbstractServiceImpl<Milestone, Long> i
} }
@Override @Override
@Transactional
public void setConfirmed(Project project, User student, MilestoneActivityTemplate activity, boolean confirmed) { public void setConfirmed(Project project, User student, MilestoneActivityTemplate activity, boolean confirmed) {
if (!project.hasModule(ProjectModule.MILESTONES)) { if (!project.hasModule(ProjectModule.MILESTONES)) {

View File

@ -1,6 +1,7 @@
package se.su.dsv.scipro.notes; package se.su.dsv.scipro.notes;
import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.core.types.dsl.BooleanExpression;
import jakarta.transaction.Transactional;
import se.su.dsv.scipro.system.AbstractServiceImpl; import se.su.dsv.scipro.system.AbstractServiceImpl;
import se.su.dsv.scipro.system.User; import se.su.dsv.scipro.system.User;
@ -20,6 +21,7 @@ public class NoteServiceImpl extends AbstractServiceImpl<Note, Long> implements
} }
@Override @Override
@Transactional
public Note getNote(User user) { public Note getNote(User user) {
Note note = findOne(hasUser(user)); Note note = findOne(hasUser(user));
if (note == null){ if (note == null){

View File

@ -50,6 +50,7 @@ public class NotificationServiceImpl extends AbstractServiceImpl<Notification,Lo
} }
@Override @Override
@Transactional
public void setRead(User user, NotificationEvent notificationEvent, boolean read) { public void setRead(User user, NotificationEvent notificationEvent, boolean read) {
Iterable<Notification> notifications = findAll( Iterable<Notification> notifications = findAll(
QNotification.notification.notificationEvent.eq(notificationEvent) QNotification.notification.notificationEvent.eq(notificationEvent)
@ -62,6 +63,7 @@ public class NotificationServiceImpl extends AbstractServiceImpl<Notification,Lo
} }
@Override @Override
@Transactional
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
// This looks so wrong but a List<Notification> is what we actually get // This looks so wrong but a List<Notification> is what we actually get
// during runtime, see SCIPRO-167935. Reflection so awesome... // during runtime, see SCIPRO-167935. Reflection so awesome...

View File

@ -48,6 +48,7 @@ public class GradingReportServiceImpl implements GradingReportTemplateService, G
} }
@Override @Override
@Transactional
public boolean updateOppositionCriteria(SupervisorGradingReport report, FinalSeminarOpposition opposition) { public boolean updateOppositionCriteria(SupervisorGradingReport report, FinalSeminarOpposition opposition) {
for (GradingCriterion gradingCriterion : report.getIndividualCriteria()) { for (GradingCriterion gradingCriterion : report.getIndividualCriteria()) {
boolean isOppositionCriterion = gradingCriterion.getFlag() == GradingCriterion.Flag.OPPOSITION; boolean isOppositionCriterion = gradingCriterion.getFlag() == GradingCriterion.Flag.OPPOSITION;

View File

@ -22,12 +22,14 @@ public class ReportServiceImpl extends AbstractServiceImpl<Report, Long> impleme
} }
@Override @Override
@Transactional
public AttachmentReport submit(AttachmentReport report) { public AttachmentReport submit(AttachmentReport report) {
report.submit(); report.submit();
return save(report); return save(report);
} }
@Override @Override
@Transactional
public void save(AttachmentReport report, Optional<FileUpload> fileUpload) { public void save(AttachmentReport report, Optional<FileUpload> fileUpload) {
storeReportFile(report, fileUpload); storeReportFile(report, fileUpload);
save(report); save(report);

View File

@ -49,6 +49,7 @@ public class ReviewerInteractionServiceImpl implements ReviewerInteractionServic
} }
@Override @Override
@Transactional
public ForumPost reply(final Project project, final User user, final String content, final Set<Attachment> attachments) { public ForumPost reply(final Project project, final User user, final String content, final Set<Attachment> attachments) {
ReviewerThread reviewerThread = getReviewerThread(project); ReviewerThread reviewerThread = getReviewerThread(project);
ForumPost reply = forumService.createReply(reviewerThread.getForumThread(), user, content, attachments); ForumPost reply = forumService.createReply(reviewerThread.getForumThread(), user, content, attachments);

View File

@ -7,6 +7,7 @@ import com.querydsl.core.types.Predicate;
import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.core.types.dsl.LiteralExpression; import com.querydsl.core.types.dsl.LiteralExpression;
import com.querydsl.jpa.impl.JPAQuery; import com.querydsl.jpa.impl.JPAQuery;
import jakarta.transaction.Transactional;
import se.su.dsv.scipro.file.FileReference; import se.su.dsv.scipro.file.FileReference;
import se.su.dsv.scipro.file.FileService; import se.su.dsv.scipro.file.FileService;
import se.su.dsv.scipro.file.FileUpload; import se.su.dsv.scipro.file.FileUpload;
@ -92,6 +93,7 @@ public class ReviewingServiceImpl extends AbstractServiceImpl<ReviewerApproval,
} }
@Override @Override
@Transactional
public void reject(final ReviewerApproval reviewerApproval, final String reason, final Optional<FileUpload> feedback) { public void reject(final ReviewerApproval reviewerApproval, final String reason, final Optional<FileUpload> feedback) {
Optional<FileReference> feedbackFile = store(feedback); Optional<FileReference> feedbackFile = store(feedback);
reviewerApproval.reject(reason, feedbackFile); reviewerApproval.reject(reason, feedbackFile);
@ -106,6 +108,7 @@ public class ReviewingServiceImpl extends AbstractServiceImpl<ReviewerApproval,
} }
@Override @Override
@Transactional
public void approve(final ReviewerApproval process, final String reason, final Optional<FileUpload> feedback) { public void approve(final ReviewerApproval process, final String reason, final Optional<FileUpload> feedback) {
Optional<FileReference> feedbackFile = store(feedback); Optional<FileReference> feedbackFile = store(feedback);
process.approve(reason, feedbackFile); process.approve(reason, feedbackFile);

View File

@ -38,6 +38,7 @@ public class UserProfileServiceImpl extends AbstractServiceImpl<UserProfile, Lon
} }
@Override @Override
@Transactional
public Roles findSelectedRole(User user) { public Roles findSelectedRole(User user) {
return findByUser(user).getSelectedRole(); return findByUser(user).getSelectedRole();
} }

View File

@ -3,6 +3,8 @@ package se.su.dsv.scipro.system;
import jakarta.inject.Inject; import jakarta.inject.Inject;
import jakarta.inject.Provider; import jakarta.inject.Provider;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
import jakarta.transaction.Transactional;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
@ -13,6 +15,7 @@ public class ResearchAreaServiceImpl extends AbstractServiceImpl<ResearchArea,Lo
} }
@Override @Override
@Transactional
public ResearchArea updateExternalResearchArea(Long identifier, String name, final boolean active) { public ResearchArea updateExternalResearchArea(Long identifier, String name, final boolean active) {
ResearchArea ra = new ResearchArea(); ResearchArea ra = new ResearchArea();
if (identifier != null) { if (identifier != null) {