Skip to content

Commit

Permalink
[MODIFY] apply @Trasactional
Browse files Browse the repository at this point in the history
-  apply @Trasactional
  • Loading branch information
himodu committed May 22, 2024
1 parent 15746af commit 338e66d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import LlikelionKNU.KNUfest.domain.user.repository.UserBoothRepository;
import LlikelionKNU.KNUfest.domain.user.service.UserService;
import LlikelionKNU.KNUfest.global.error.NoExistException;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

Expand All @@ -20,6 +21,7 @@
import java.util.Optional;

@Service
@Transactional
@RequiredArgsConstructor
public class BoothServiceImpl implements BoothService{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import LlikelionKNU.KNUfest.domain.user.service.UserService;
import LlikelionKNU.KNUfest.global.error.NoExistException;
import LlikelionKNU.KNUfest.global.error.UserHashWrongException;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

Expand All @@ -18,6 +19,7 @@
import java.util.Optional;

@Service
@Transactional
@RequiredArgsConstructor
public class CommentServiceImpl implements CommentService{
private final CommentRepository commentRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import LlikelionKNU.KNUfest.domain.user.entity.UserCountEntity;
import LlikelionKNU.KNUfest.domain.user.repository.UserCountRepository;
import LlikelionKNU.KNUfest.global.error.NoExistException;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
@Transactional
@RequiredArgsConstructor
public class UserCountServiceImpl implements UserCountService {
private final UserCountRepository userCountRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import LlikelionKNU.KNUfest.domain.user.repository.UserCountRepository;
import LlikelionKNU.KNUfest.domain.user.repository.UserRepository;
import LlikelionKNU.KNUfest.global.error.NoExistException;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
@Transactional
@RequiredArgsConstructor
public class UserServiceImpl implements UserService{
private final UserRepository userRepository;
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://mysql-withvol:3306/knufest?serverTimezone=Asia/Seoul
username: user
url: jdbc:mysql://localhost:3306/knufest?serverTimezone=Asia/Seoul
username: root
password: 1234

jpa:
Expand Down

0 comments on commit 338e66d

Please sign in to comment.