본문 바로가기

분류 전체보기

(75)
[자바 ORM 표준 JPA 프로그래밍] JPA 소개 * 김영한 강사님의 자바 ORM 표준 JPA 프로그래밍 강의를 정리한 내용입니다. JPA를 사용하면 좋은 점 개발 생산성 증가 개발 속도, 유지 보수가 좋다. 객체와 테이블을 생성하고 올바르게 매핑하는 방법을 알아야함 목표 - 객체와 테이블 설계 매핑 기본 키와 외래 키 매핑 1:N, N:1, N:M 매핑 실무 노하우 + 성능까지 고려 어떠한 복잡한 시스템도 JPA로 설계 가능 목표 - JPA 내부 동작 방식 이해 JPA의 내부 동작 방식을 이해하지 못하고 사용 JPA가 어떤 SQL을 만들어 내는지 이해 JPA가 언제 SQL을 실행하는지 이해 SQL 중심적인 개발의 문제점 계속해서 쿼리를 작성해야함 ;;;; 무한 반복, 지루한 코드 SQL에 의존적인 개발을 피하기 어렵다. 객체 지향 프로그래밍 : 추상화..
[Day5] Maximum Subarray https://leetcode.com/problems/maximum-subarray/ Maximum Subarray - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com int형 nums 배열이 있다. 가장 큰 합을 가지는 하위 배열을 찾고 그것의 합을 리턴해라. 현재 합과 지금까지 구한 합의 최대 값을 계속 비교해서 가장 큰 합의 subarray를 구한다. 이때, 현재 합인 sum이 음수가 나오면 합을 다음 합을 구할 때, 최대가 될 수 없기 때문에 sum을 0으..
[Plantity] 식물 로그 상세조회 API 식물로그 상세 조회 수정 전 logic GET을 사용해서 sun, repot, water, look 과제에 대한 boolean 값을 보여준다. (.. 근데 이것도 잘못 작성한듯^^) 식물로그 상세 조회 수정 방안 GET을 POST로 바꾸기. 날짜 입력하면 그 날에 각 로그들의 boolean 값을 보여주도록 수정한다.
[Day3] Contains Duplicate https://leetcode.com/problems/contains-duplicate/ Contains Duplicate - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com int형인 배열 nums이 있다. 같은 값이 배열에서 최소 두번이상 나오면 true를 return하고 모든 요소들이 구별된다면 false를 return해라. 1. 배열이라는 점을 사용해서 정렬한다. 정렬한 후, 인접 인덱스를 비교하여 같은 숫자가 있다면 true를 return하도록 작성한다...
[Day2] Best Time to Buy and Sell Stock https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ Best Time to Buy and Sell Stock - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com prices 배열이 있다. 각 인덱스 i는 day고 각 날의 stock 가격이 prices[i]를 의미한다. 이익을 최대화하기 위해 한 날짜를 선택하고 하나의 stock을 산다. 그리고 다른 미래의 날짜를 선택하고 stock을 판다. 이 거래에서..
[Day1] Two Sum https://leetcode.com/problems/two-sum/ Two Sum - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com int형인 nums 배열과 변수 target이 있다. 배열에서 2개의 숫자 합이 target 값이 되도록 하는 인덱스를 리턴하도록 만든다. 1. Brute-force 사용하기 '무식한 힘'이라는 알고리즘으로 가능한 모든 경우의 수를 탐색하면서 요구조건에 충족되는 결과만을 가져온다. 문제를 보자마자 첫 번째로 생각난 방법 2. Ha..
오늘부터 하루에 한 문제씩 Leetcode 시작~! Let's start Leetcode~!
[SpringBoot JPA] PUT mapping을 사용한 API 작성하기 PlantLog에서 광합성, 물주기, 관찰, 분갈이 버튼을 누르면 true로 바뀌는 API를 설계해야한다. 1️⃣ domain (PlantLog, Log) @Getter @NoArgsConstructor @Entity public class PlantLog extends BaseTimeEntity { @Embedded private Log log; @Builder public PlantLog(Long plantId, MyPlant myPlant, Log log) { this.plantId = plantId; this.myPlant = myPlant; this.log = log; } public void updateRepot(Boolean repot){ log.updateRepot(repot); } pub..