spring boot

    [Spring Data Jpa] (JUNIT, DDL) 외래키 제약조건에 NOT NULL을 추가해보자.

    책 DB ( Book Entity ) package com.example.jpa.domain; @Entity @NoArgsConstructor @Data @ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) public class Book extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private String category; private Long authorId; private Long publisherId; } PK로 id를 들고있고 문자열 타입으로 name, category, ..

    naver search api 사용해서 rest-api 구현하기

    JPA가 없는 IN-MEMORY DB구현 MemoryDbRepositoryInterface package com.example.restaurant.db; import java.util.List; import java.util.Optional; public interface MemoryDbRepositoryIfs { Optional findById(int index); T save(T entity); void deleteById(int index); List findAll(); } MemoryDbRepositoryAbstract package com.example.restaurant.db; import java.util.ArrayList; import java.util.List; import java.ut..