20
20
import org .woehlke .java .simpleworklist .domain .db .data .context .ContextRepository ;
21
21
22
22
@ Slf4j
23
- @ Service ( "userAccountService" )
24
- // @Transactional(propagation = Propagation.REQUIRED, readOnly = true)
23
+ @ Service
24
+ @ Transactional (propagation = Propagation .REQUIRED , readOnly = true )
25
25
public class UserAccountServiceImpl implements UserAccountService {
26
26
27
27
private final UserAccountRepository userAccountRepository ;
@@ -30,7 +30,11 @@ public class UserAccountServiceImpl implements UserAccountService {
30
30
private final PasswordEncoder encoder ;
31
31
32
32
@ Autowired
33
- public UserAccountServiceImpl (UserAccountRepository userAccountRepository , ChatMessageRepository userMessageRepository , ContextRepository contextRepository ) {
33
+ public UserAccountServiceImpl (
34
+ UserAccountRepository userAccountRepository ,
35
+ ChatMessageRepository userMessageRepository ,
36
+ ContextRepository contextRepository
37
+ ) {
34
38
this .userAccountRepository = userAccountRepository ;
35
39
this .userMessageRepository = userMessageRepository ;
36
40
this .contextRepository = contextRepository ;
@@ -64,7 +68,7 @@ public void createUser(UserAccountForm userAccountForm) {
64
68
}
65
69
66
70
@ Override
67
- // @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
71
+ @ Transactional (propagation = Propagation .REQUIRES_NEW , readOnly = false )
68
72
public UserAccount saveAndFlush (UserAccount u ) {
69
73
return userAccountRepository .saveAndFlush (u );
70
74
}
@@ -80,7 +84,7 @@ public Page<UserAccount> findAll(Pageable request) {
80
84
}
81
85
82
86
@ Override
83
- // @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
87
+ @ Transactional (propagation = Propagation .REQUIRES_NEW , readOnly = false )
84
88
public void changeUsersPassword (UserAccountForm userAccount ) {
85
89
UserAccount ua = userAccountRepository .findByUserEmail (userAccount .getUserEmail ());
86
90
if (ua != null ) {
@@ -103,7 +107,8 @@ public Map<Long, Integer> getNewIncomingMessagesForEachOtherUser(UserAccount rec
103
107
if (receiver .getId ().longValue () == sender .getId ().longValue ()){
104
108
newIncomingMessagesForEachOtherUser .put (sender .getId (),0 );
105
109
} else {
106
- List <UserAccountChatMessage > userAccountChatMessages = userMessageRepository .findBySenderAndReceiverAndReadByReceiver (sender ,receiver ,false );
110
+ List <UserAccountChatMessage > userAccountChatMessages =
111
+ userMessageRepository .findBySenderAndReceiverAndReadByReceiver (sender ,receiver ,false );
107
112
newIncomingMessagesForEachOtherUser .put (sender .getId (), userAccountChatMessages .size ());
108
113
}
109
114
}
0 commit comments