๐ŸŒŸ CRUD ๊ธฐ๋Šฅ๊ตฌํ˜„

Create = POST / body
: create๋Š” ์„œ๋ฒ„์— ์ •๋ณด๋ฅผ ์˜ฌ๋ ค๋‹ฌ๋ผ๋Š” ์š”์ฒญ, create๋Š” post๋ฅผ ํ†ตํ•ด ํ•ด๋‹น URI๋ฅผ ์š”์ฒญํ•˜๋ฉด ๋ฆฌ์†Œ์†Œ๋ฅผ ์ƒ์„ฑํ•จ.

Read = GET / param
: read๋Š” ์„œ๋ฒ„์—์„œ ์ •๋ณด๋ฅผ ๋ถˆ๋Ÿฌ์˜ค๋Š” ์š”์ฒญ. GET์„ ํ†ตํ•ด ํ•ด๋‹น ๋ฆฌ์†Œ์†Œ๋ฅผ ์กฐํšŒํ›„ ํ•ด๋‹น ๋„ํ๋จผํŠธ์— ๋Œ€ํ•œ ์ž์„ธํ•œ ์ •๋ณด๋ฅผ ๊ฐ€์ ธ์˜ด.

Update = PUT / body
: update๋Š” ์ •๋ณด๋ฅผ ๋ฐ”๊พธ๋Š” ์š”์ฒญ.

Delete = DELETE / param
: delete๋Š” ์ •๋ณด๋ฅผ ์ง€์šฐ๋Š” ์š”์ฒญ. DELETE๋ฅผ ํ†ตํ•ด ๋ฆฌ์†Œ์Šค๋ฅผ ์‚ญ์ œํ•  ์ˆ˜ ์žˆ์Œ.

์šฐ๋ฆฌ ์Šคํ„ฐ๋””์—์„œ๋Š” JPA๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ตฌํ˜„ํ•ด๋ณด๊ธฐ๋กœ ํ•˜์˜€๋‹ค.

๋จผ์ € Repository์— ๋Œ€ํ•ด ์ •๋ฆฌํ•˜์ž๋ฉด
Repository์˜ ์ •ํ™•ํ•œ ์‚ฌ์šฉ์€ DAO๋ฅผ ์œ„ํ•ด ์‚ฌ์šฉํ•˜๋Š” ์–ด๋…ธํ…Œ์ด์…˜์ธ๋ฐ JpaRepository๋Š” JPA์˜ ๊ตฌํ˜„์ฒด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค.์šฐ๋ฆฌ๊ฐ€ JPA์˜ ๊ฐ€์žฅ ํฐ ์žฅ์ ์€ ๋ฐ์ดํ„ฐ์˜ ํšจ์œจ์ ์ธ ์ €์žฅ๊ณผ ์ฒ˜๋ฆฌ ๋ฐ ๊ฐ€๊ณต์ด๋ผ๊ณ  ์•„๊นŒ ์ด์•ผ๊ธฐ์ธ๋ฐ ๊ทธ๋Ÿฐ ๋ฐ์ดํ„ฐ์˜ ํšจ์œจ์ ์ธ ์ฒ˜๋ฆฌ๋ฅผ ์œ„ํ•ด์„œ Jpa๋Š” ๊ธฐ๋ณธ์ ์ธ CRUD๊ฐ€ ์ •์˜๋˜์–ด ์žˆ๋Š” JpaRepository๋ฅผ ๊ตฌํ˜„ํ•˜์˜€๊ณ  ์‚ฌ์šฉ์ž๋“ค์€ ๊ทธ ๊ตฌํ˜„์ฒด๋ฅผ ์ƒ์†ํ•˜์—ฌ ์‚ฌ์šฉํ•œ๋‹ค.

HealthRepository.java

package com.example.demo.repository;

import com.example.demo.domain.HealthInfo;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.awt.print.Pageable;
import java.util.List;

public interface HealthRepository extends JpaRepository<HealthInfo,Long> {


}

๊ฐ ๊ธฐ๋Šฅ๋“ค์„ ์ธํ„ฐํŽ˜์ด์Šค๋กœ ์ •์˜ํ•˜๊ณ 

HealthService.java

import com.example.demo.data.request.HealthRequestDTO;
import com.example.demo.data.response.HealthResponseDTO;

public interface HealthService {

    public HealthResponseDTO read(Long id);

    public boolean saveHealth(HealthRequestDTO healthRequestDTO);

    public boolean updateHealth(HealthRequestDTO healthRequestDTO);

    public boolean deleteHealth(Long id);

}

๋ฉ”์†Œ๋“œ ๋ช…์—์„œ ์•Œ ์ˆ˜ ์žˆ๋‹ค์‹œํ”ผ read, save, update, delete๋ฅผ ์ •์˜ํ•˜์˜€๋‹ค.

๊ทธ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ๊ตฌํ˜„ํ•˜๋Š” ํด๋ž˜์Šค๋ฅผ ๋”ฐ๋กœ ๋งŒ๋“ค์—ˆ๋‹ค.

HealthServiceImpl.java

package com.example.demo.service.impl;

import com.example.demo.data.request.HealthRequestDTO;
import com.example.demo.data.response.HealthResponseDTO;
import com.example.demo.data.response.ReviewResponseDTO;
import com.example.demo.domain.HealthInfo;
import com.example.demo.domain.Review;
import com.example.demo.repository.BoardRepository;
import com.example.demo.repository.HealthRepository;
import com.example.demo.repository.ReviewRepository;
import com.example.demo.service.HealthService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
@Slf4j
public class HealthServiceImpl implements HealthService {


    private final HealthRepository healthRepository;
    private final ReviewRepository reviewRepository;
    @Override
    public HealthResponseDTO read(Long id){
        HealthInfo healthInfo = healthRepository.findById(id)
                .orElseThrow(RuntimeException::new);
        HealthResponseDTO a=  HealthResponseDTO.builder()
                .id(healthInfo.getId())
                .brand_name(healthInfo.getBrand_name())
                .category(healthInfo.getCategory())
                .land_number(healthInfo.getLand_number())
                .road_number(healthInfo.getRoad_number())
                .build();

        return a;
    }

    @Override
    public boolean saveHealth(HealthRequestDTO healthRequestDTO){
        healthRepository.save(healthRequestDTO.toEntity(healthRequestDTO));
        return false;
    }
    public boolean updateHealth(HealthRequestDTO healthRequestDTO){

        HealthInfo healthInfo = healthRepository.findById(healthRequestDTO.getId()).orElseThrow(RuntimeException::new);
        healthInfo.modifyHealthinfo(healthRequestDTO.getBrand_name()
                                    ,healthRequestDTO.getLand_number()
                                    ,healthRequestDTO.getRoad_number()
                                    ,healthRequestDTO.getCategory());

        try{
            healthRepository.save(healthInfo);
        }catch (Exception e){
            return false;
        }
        return true;
    };

    public boolean deleteHealth(Long id){
        healthRepository.deleteById(id);
        return true;
    };

}

read ( ์กฐํšŒ )

MainController.java

    @GetMapping("/read")
    public ResponseEntity<HealthResponseDTO> getRead(@RequestParam Long id){
        return ResponseEntity.ok(healthService.read(id));

    }

User๊ฐ€ GET๋ฐฉ์‹์œผ๋กœ "localhost:8080/read?id=1"๋ฅผ ์š”์ฒญํ•˜๋ฉด id๊ฐ’์„ ๊ฐ€์ง€๊ณ  healthService์— ์žˆ๋Š” read๋ฅผ ์‹คํ–‰ํ•œ๋‹ค.

HealthServiceImpl.java

@Override
    public HealthResponseDTO read(Long id){
        HealthInfo healthInfo = healthRepository.findById(id)
                .orElseThrow(RuntimeException::new);

        return HealthResponseDTO.builder()
                .id(healthInfo.getId())
                .brand_name(healthInfo.getBrand_name())
                .category(healthInfo.getCategory())
                .land_number(healthInfo.getLand_number())
                .road_number(healthInfo.getRoad_number())
                .build();
    }

healthInfo ๊ฐ์ฒด์— Controller์—์„œ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ๋“ค์–ด์˜จ id๊ฐ’์„ ๊ฐ€์ง€๊ณ  Repository์—์„œ ํ•ด๋‹น id๊ฐ’์„ ๊ฐ€์ง„ ์ •๋ณด๋ฅผ DB์—์„œ ์ฐพ์•„ ๋Œ€์ž…ํ•œ๋‹ค.

healthInfo์— ์žˆ๋Š” ์ •๋ณด๋“ค์„ getter๋กœ ๊ฐ€์ ธ์™€ HealthResponseDTO๊ฐ์ฒด๋ฅผ builderํŒจํ„ด์œผ๋กœ ์ƒ์„ฑํ•ด ๋ฆฌํ„ดํ•œ๋‹ค.

MainController.java

return ResponseEntity.ok(healthService.read(id));

Service์—์„œ ๋ฆฌํ„ดํ•œ ๊ฐ’(์‘๋‹ต ์ •๋ณด)์„ ๊ฐ€์ง€๊ณ  ResponseEntity์˜ ok๋ฉ”์†Œ๋“œ๋ฅผ ์‹คํ–‰ํ•œ๋‹ค.

ResponseEntity๋ž€
ResponseEntity๋ž€, httpentity๋ฅผ ์ƒ์†๋ฐ›๋Š”, ๊ฒฐ๊ณผ ๋ฐ์ดํ„ฐ์™€ HTTP ์ƒํƒœ ์ฝ”๋“œ๋ฅผ ์ง์ ‘ ์ œ์–ดํ•  ์ˆ˜ ์žˆ๋Š” ํด๋ž˜์Šค์ด๋‹ค.
ResponseEntity์—๋Š” ์‚ฌ์šฉ์ž์˜ HttpRequest์— ๋Œ€ํ•œ ์‘๋‹ต ๋ฐ์ดํ„ฐ๊ฐ€ ํฌํ•จ๋œ๋‹ค.

save(์ €์žฅ)

MainController.java

    @PostMapping("/save")
    public ResponseEntity<Boolean> postSave(@RequestBody HealthRequestDTO healthRequestDTO){
        try{
            healthService.saveHealth(healthRequestDTO);
        }catch (Exception e){
            return ResponseEntity.ok(false);
        }
        return ResponseEntity.ok(true);
    }

์ €์žฅ์€ post๋ฐฉ์‹์œผ๋กœ ์‹คํ–‰ํ•œ๋‹ค.
์˜ค๋ฅ˜๊ฐ€ ๋‚  ๊ฐ€๋Šฅ์„ฑ์ด ์žˆ๋Š” healthService.saveHealth(healthRequestDTO);์ฝ”๋“œ๋ฅผ try๋ฌธ์œผ๋กœ ๊ฐ์ŒŒ๊ณ , ์˜ค๋ฅ˜๊ฐ€ ๋‚œ๋‹ค๋ฉด false๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค.

saveHealth์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋Š” healthRequestDTO(์š”์ฒญ๋ฐ์ดํ„ฐ)๋‹ค.

HealthServiceImpl.java

@Override
    public boolean saveHealth(HealthRequestDTO healthRequestDTO){
        healthRepository.save(healthRequestDTO.toEntity(healthRequestDTO));
        return false;
    }

saveHealth์˜ ๋ฉ”์†Œ๋“œ ๋‚ด์šฉ์ด๋‹ค. healthRequestDTOํด๋ž˜์Šค์˜ toEntity๋ฉ”์†Œ๋“œ์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœController์—์„œ ์˜จ ์š”์ฒญ๋ฐ์ดํ„ฐ(healthRequestDTO)๋ฅผ ๋ณด๋‚ธ๋‹ค.

HealthRequestDTO.java

public static HealthInfo toEntity(HealthRequestDTO dto){
        return HealthInfo.builder()
                .id(dto.getId())
                .brand_name(dto.getBrand_name())
                .category(dto.getCategory())
                .land_number(dto.getLand_number())
                .road_number(dto.getRoad_number())
                .reviews(dto.getReview().getHealthInfo().getReviews())
                .build();
    }

toEntity๋ฉ”์†Œ๋“œ๋Š” dto์˜ ๊ฐ’์„ Entity๊ฐ’์œผ๋กœ ๋ฐ”๊ฟ”์ฃผ๋Š” ์—ญํ• ์„ ํ•œ๋‹ค.
์—ฌ๊ธฐ์— toEntity์— ๋Œ€ํ•œ ๋ณด๋‹ค ์ž์„ธํ•œ ํฌ์ŠคํŒ…์ด ์žˆ๋‹ค.(๋‚˜๋„ ์ด๊ฑฐ ๋ณด๊ณ  ์ดํ•ดํ•จ)
์•„๋ฌดํŠผ ๊ทธ ์š”์ฒญ ๋ฐ์ดํ„ฐ๋กœ helathinfo์˜ ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•œ ๋’ค, ๊ทธ ๋‚ด์šฉ์„ repository์˜ save๋กœ ์ €์žฅํ•œ๋‹ค.

Update (์ˆ˜์ •)

MainController.java

    @PutMapping("/update")
    public ResponseEntity<Boolean> updateSave(@RequestBody HealthRequestDTO healthRequestDTO){
        try{
            healthService.updateHealth(healthRequestDTO);
        }catch (Exception e){
            return ResponseEntity.ok(false);
        }

        return ResponseEntity.ok(true);
    }

update๋„ save์™€ ์œ ์‚ฌํ•œ ๋ฐฉ์‹์œผ๋กœ ๊ตฌํ˜„ํ•œ๋‹ค. save์™€ ๊ฐ€์žฅ ํฐ ๋‹ค๋ฅธ ์ ์€ put๋ฐฉ์‹์ด๋ผ๋Š” ๊ฒƒ์ด๋‹ค.

HealthServiceImpl.java

public boolean updateHealth(HealthRequestDTO healthRequestDTO){

        HealthInfo healthInfo = healthRepository.findById(healthRequestDTO.getId()).orElseThrow(RuntimeException::new);
        healthInfo.modifyHealthinfo(healthRequestDTO.getBrand_name()
                                    ,healthRequestDTO.getLand_number()
                                    ,healthRequestDTO.getRoad_number()
                                    ,healthRequestDTO.getCategory());

        try{
            healthRepository.save(healthInfo);
        }catch (Exception e){
            return false;
        }
        return true;
    };

์ €์žฅ์€ ๊ทธ๋ƒฅ ํ•˜๋ฉด ๋์ง€๋งŒ update๋Š” ๊ธฐ์กด์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ •ํ•ด์•ผํ•˜๊ธฐ๋•Œ๋ฌธ์— id๋กœ ๋จผ์ € ํ•ด๋‹น ๋ฐ์ดํ„ฐ๋ฅผ ์ฐพ๋Š”๋‹ค.
HealthInfo.java

public void modifyHealthinfo(String brand_name,String land_number,String road_number, String category){
                this.brand_name=brand_name;
                this.land_number=land_number;
                this.road_number=road_number;
                this.category=category;
        }

๊ทธ ํ›„ ๋ฏธ๋ฆฌ ์ •์˜ํ•œ ๋ฉ”์„œ๋“œ๋กœ ์š”์ฒญ๋ฐ์ดํ„ฐ๋ฅผ ๋‹ค์‹œ setํ•œ๋‹ค.
๊ทธ๋ฆฌ๊ณ  ๊ทธ ์ •๋ณด๋ฅผ ์ €์žฅํ•œ๋‹ค. ๊ทธ๋Ÿผ ์ˆ˜์ • ๋ ใ…‹ ใ…‹

์—ฌ๋‹ด์œผ๋กœ ํŒ€์›๋ผ๋ฆฌ ์—ญํ• ์„ ๋”ฐ๋กœ ๋งก์•„์„œ ๊ตฌํ˜„ํ–ˆ๋Š”๋ฐ ๋‚ด๊ฐ€ update๋ฅผ ๋งก์•˜์—ˆ๋‹ค.. 
๊ทผ๋ฐ ์ง„์งœ ๋ญ๊ฐ€ ๋ญ”์ง€ ํ•˜๋‚˜๋„ ๋ชจ๋ฅด๊ฒ ์–ด์„œ ๊ฒฐ๊ตญ ํŒ€์žฅ๋‹˜์ด ๊ตฌํ˜„ํ•ด์ฃผ์‹ฌ ^^.. 
์„ค๋ช… ๋“ค์„๋•Œ๋Š” ์ดํ•ด๊ฐ€๋Š”๋ฐ ๋ง‰์ƒ ๋‚ด๊ฐ€ ํ•˜๋ ค๋ฉด ๋ชจ๋ฅด๊ฒ ๋Š”๊ฑฐ,,, ๋‚˜๋งŒ๊ทธ๋Ÿฐ๊ฐ€์š”์˜ค,..?

Delete(์‚ญ์ œ)

MainController.java

    @DeleteMapping("/delete")
    public ResponseEntity<Boolean> getDelete(@RequestParam Long id){
        return ResponseEntity.ok(healthService.deleteHealth(id));
    }

delete๋Š” ์กฐํšŒ์™€ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ id๊ฐ’์„ ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ๋ฐ›๋Š”๋‹ค.
๋ฐ›์€ id๋กœ healthService.deleteHealth๋ฅผ ์‹คํ–‰ํ•œ๋‹ค.

HealthServiceImpl.java

public boolean deleteHealth(Long id){
        healthRepository.deleteById(id);
        return true;
    };

delete๋Š” ์ œ์ผ ๊ฐ„๋‹จํ•˜๋‹ค ์šฐํ•˜ํ•˜
id๋กœ repository์˜ deleteById๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ•ด๋‹น ๋ฐ์ดํ„ฐ๋ฅผ ์ง€์›Œ์ค€๋‹ค

์‹คํ–‰

์ด๋ ‡๊ฒŒ ๋ฌด์ž‘์ • CRUD๊ฒŒ์‹œํŒ ๋งŒ๋“ค๊ธฐ๊ฐ€ ๋์ด๋‚ฌ๋‹ค. !! ์ด์ œ ์ง„์งœ๋กœ ์ œ๋Œ€๋กœ๋œ ๊ตฌํ˜„์ด ๋˜๋Š”์ง€ ๋ณด์ž๊ตฌ์š”์˜ค ๐Ÿคญ
ํ”„๋กœ์ ํŠธ์™€ ์—ฐ๊ฒฐ๋˜์–ด์žˆ๋Š” ํ…Œ์ด๋ธ”์„ ์›Œํฌ๋ฒค์น˜๋ฅผ ํ†ตํ•ด ๋จผ์ € ์กฐํšŒํ•ด๋ณด์•˜๋‹ค.

ui๋ฅผ ๋”ฐ๋กœ ๋งŒ๋“ค์ง€ ์•Š์•„ ๋ชจ๋“  ์‹คํ–‰์€ Swagger๋กœ ๋Œ€์‹ ํ•˜์˜€๋‹ค ๐Ÿฅณ

๐Ÿง ์กฐํšŒ


DB์— ์—ฐ๊ฒฐ๋œ ์ž๋ฃŒ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์กฐํšŒ๋œ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค :) ์šฐํ•˜ํ•˜

๐Ÿ’ฟ ์ €์žฅ

Swagger๋กœ ํ•ด๋‹น๋ฐ์ดํ„ฐ๋“ค์„ ์ €์žฅํ•˜์˜€๋‹ค. id๊ฐ’์€ ์ž๋™์œผ๋กœ ๋„ฃ์–ด์ฃผ๊ธฐ ๋•Œ๋ฌธ์— ๋”ฐ๋กœ ์ง€์ •ํ•˜์ง€ ์•Š์•˜๊ณ ,
์ด๋ฆ„์€ ์šฐํ•˜ํ•˜ ์นดํ…Œ๊ณ ๋ฆฌ๋Š” ํ—ฌ์Šค์žฅ landnumber๋Š” ์„œ์šธ์‹œ ์–ด์ฉŒ๊ณ  road_number๋Š” ์ €์ฉŒ๊ณ ๋กœ ์ €์žฅํ–ˆ๋‹ค.
์›Œํฌ๋ฒค์น˜์—์„œ ํ™•์ธํ•ด๋ณด๋‹ˆ ์ •์ƒ์ ์œผ๋กœ ๊ฐ’์ด ๋“ค์–ด๊ฐ„๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค !

๐Ÿ‘จ๐Ÿปโ€๐ŸŽจ ์ˆ˜์ •


๋ฐฉ๊ธˆ ์ €์žฅํ•œ id 93๋ฒˆ ๋ฐ์ดํ„ฐ๋ฅผ ์ด๋ฆ„ ์ˆ˜์ •ํ•˜๊ฒ ์Šด๋‹ˆ๋‹ค.. ์นดํ…Œ๊ณ ๋ฆฌ๋Š” ํ—ฌ์Šค์žฅใ…‹ใ…‹ land_number๋Š” ๊ฒฝ๊ธฐ๋„, road_number๋Š” ์–ด์ฉŒ๊ตฌ๋กœ ์ˆ˜์ •ํ•˜์˜€๋‹ค.
๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ์›Œํฌ๋ฒค์น˜์—์„œ ํ™•์ธํ•ด๋ณด๋‹ˆ ์ •์ƒ์ ์œผ๋กœ ์ž˜ ์ˆ˜์ •๋œ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค !! ๊บ„์•„

๐Ÿ™…โ€โ™‚๏ธ ์‚ญ์ œ

์•„๊นŒ ์ €์žฅํ•˜๊ณ  ์ˆ˜์ •ํ–ˆ๋˜ 93๋ฒˆ ๋ฐ์ดํ„ฐ๋ฅผ ์‚ญ์ œํ–ˆ๋‹ค.

์›Œํฌ๋ฒค์น˜์—์„œ ํ™•์ธํ•ด๋ณด๋ฉด? ์•„์ฃผ ์ž˜ ์ง€์›Œ์ง„๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค!!!

๋งˆ์น˜๋ฉฐ

์‚ฌ์‹ค ์ฒ˜์Œ์—๋Š” ํ˜ธ๊ธฐ๋กญ๊ฒŒ ์‹œ์ž‘ํ–ˆ๋‹ค๊ฐ€ ์—„์ฒญ๋‚˜๊ฒŒ ๋ง‰๋ง‰ํ–ˆ๋˜ ์ฒซ ์Šคํ”„๋ง๋ถ€ํŠธ ํ”„๋กœ์ ํŠธ์˜€๋‹ค.
์‚ฌ์‹ค ์œ„ ๊ธฐ๋Šฅ์ค‘์— ๋‚ด๊ฐ€ ์ œ๋Œ€๋กœ ๊ตฌํ˜„ํ•ด๋ณธ ๊ฒƒ์€ ์—†์ง€๋งŒ ์ด ํ”„๋กœ์ ํŠธ๋ฅผ ํ†ตํ•ด Entity, Service, DTO, Reposity๋“ฑ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ๋ฅผ ๊ณต๋ถ€ํ•  ์ˆ˜ ์žˆ์—ˆ๊ณ , ์ ˆ๋Œ€ ์ดํ•ด ์•ˆ๊ฐˆ๊ฒƒ ๊ฐ™๋˜ ์ฝ”๋“œ๋“ค๋„ ์ ์  ๋ˆˆ์— ๋“ค์–ด์˜ค๋Š” ์ค‘์ด๋‹ค. ๋ฐฑ๋ฌธ์ด ๋ถˆ์—ฌ์ผ๊ฒฌ์ด๋ผ๊ณ  ๊ฐ•์˜๋งŒ ๋“ฃ๋Š” ๊ฒƒ๋ณด๋‹ค ์ง์ ‘์ด๋ ‡๊ฒŒ ๋ถ€๋”ชํ˜€๋ณด๋Š”๊ฒŒ ํ›จ์”ฌ ๋„์›€์ด ๋œ๋‹ค๊ณ  ๋Š๋‚€๋‹ค :) !!

์˜ค๋Š˜์€ ํ•™์›์„ ๋‹ค๋‹Œ์ง€ ๋”ฑ 1๋‹ฌ์ด ๋˜๋Š”๋‚ ์ด๋‹ค ์‹œ๊ฐ„ ์ •๋ง์ •๋ง ์ฐธ ๋น ๋ฅด๋‹ค
๋‚˜์ค‘์— ๋’ค๋Œ์•„๋ดค์„๋•Œ ์‹œ๊ฐ„ ์•„๊น๊ฒŒ์จ์„œ ํ›„ํšŒํ•˜์ง€ ์•Š์œผ๋ ค๋ฉด ์—ด์‹ฌํžˆ ํ•ด์•ผ๊ฒ ๋‹ค๋Š” ์ƒ๊ฐ์ด ๋“ญ๋‹ˆ๋‹ค์•„ ๐Ÿคง

๋‹ค์Œ ํฌ์ŠคํŒ…์€ ๋Œ“๊ธ€ CRUD๊ฐ€ ๋˜์ง€์•Š์„๊นŒ ์‹ถ๋‹ค :) !

๐Ÿ’กReference

https://thalals.tistory.com/268

0๊ฐœ์˜ ๋Œ“๊ธ€