JPA(25)
-
[Admin_상품등록] 다중 이미지 삽입 / 이미지-상품 테이블 조인 / enum 카테고리, 판매 상태(1)
🟢 Constant 열거형 : 고정된 값들의 집합 ▪️ CategoryTypeRole 제품 카테고리 설정 CategoryTypeRole이라는 열거형 정의 열거 상수(ALL, LIVING, BATHROOM, KITCHEN, MEMBERSALE)는 해당 카테고리의 설명(description)을 가지고 있음 생성자 : 열거 상수를 정의할 때, 상수의 값을 초기화하기 위해 사용 getter메서드 : 외부에서 열거 상수의 설명을 알고 싶을 때, getDescription 메서드를 호출하여 해당 열거 상수의 설명을 반환 public enum CategoryTypeRole { ALL("전체"), LIVING("생활용품"), BATHROOM("욕실용품"), KITCHEN("주방용품"), MEMBERSALE("회원전용"..
2024.01.19 -
[Java+SpringBoot+JPA] 테이블 조인 / 댓글 수정 기능
[Java+SpringBoot+JPA] 테이블 조인을 활용한 댓글 기능(1) 🟢 Constant 훈련기관 enum 열거형으로 설정 public enum StudyRole { A("우리인재개발원"), B("더조은아카데미"), C("그린컴퓨터"), D("직업전문학원"); private String description; StudyRole(String description) { this.descripti dalhyehye.tistory.com [Java+SpringBoot+JPA] 테이블 조인을 활용한 댓글 기능+좋아요/싫어요(2) [Java+SpringBoot+JPA] 테이블 조인을 활용한 댓글 기능(1) 🟢 Constant 훈련기관 enum 열거형으로 설정 public enum StudyRole { A("..
2024.01.12 -
[Java+SpringBoot+JPA] 테이블 조인을 활용한 댓글 기능+좋아요/싫어요(2)
[Java+SpringBoot+JPA] 테이블 조인을 활용한 댓글 기능(1) 🟢 Constant 훈련기관 enum 열거형으로 설정 public enum StudyRole { A("우리인재개발원"), B("더조은아카데미"), C("그린컴퓨터"), D("직업전문학원"); private String description; StudyRole(String description) { this.descripti dalhyehye.tistory.com 🟢 CommentEntity ▪️ FetchType : 연관 엔티티를 어떻게 가져올 것인지를 지정 ▪️ FetchType.LAZY : 연관 엔티티가 필요할 때 로딩 (즉, 처음에는 연관 엔티티를 가져오지 않고, 실제로 엔티티에 접근할 때 가져옴) @Entity @Gett..
2024.01.11 -
[Java+SpringBoot+JPA] 테이블 조인을 활용한 댓글 기능(1)
🟢 Constant 훈련기관 enum 열거형으로 설정 public enum StudyRole { A("우리인재개발원"), B("더조은아카데미"), C("그린컴퓨터"), D("직업전문학원"); private String description; StudyRole(String description) { this.description = description; } public String getDescription() { return description; } } 🟢 Entity @Entity @Getter @Setter @ToString @Builder @AllArgsConstructor @NoArgsConstructor @Table(name = "study") public class StudyEntity e..
2024.01.11 -
[Java+SpringBoot+JPA] 이미지 삽입을 활용한 게시판 만들기
🟢 Constant ▪️ Role을 이용해 책 카테고리 분류 (한글로 불러올 예정) public enum BookRole { ALL("전체"), CULTURE("교양"), COMPUTER("컴퓨터"), NOVEL("소설"), STUDY("학습"), ETC("기타"); private String description; BookRole(String description) { this.description = description; } public String getDescription() { return description; } } 🟢 Entity ▪️ Role을 이용해 책 카테고리 분류 (한글로 불러올 예정) @Entity @Getter @Setter @ToString @AllArgsConstructor..
2024.01.09 -
[Java+SpringBoot+JPA] To do List 게시판 만들기 (시작일/마감일 설정)
🟢 Entity @Entity @Getter @Setter @ToString @Builder @AllArgsConstructor @NoArgsConstructor @Table(name = "todolist") @SequenceGenerator( name = "todolist_SEQ", sequenceName = "todolist_SEQ", allocationSize = 1, initialValue = 1) public class TodoEntity { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "todolist_SEQ") @Column(name="num") private Integer num; @Column(name="titl..
2024.01.09