전체 글(68)
-
SpringBoot + JPA 조인테이블 직접 설정 및 정렬 컬럼 추가
// 강좌 와 시리즈 조인 테이블 @Data @Entity @Builder @AllArgsConstructor @NoArgsConstructor public class LectureSeriesLecture{ @Id private Long id; @ManyToOne @JoinColumn(name="lectureSeriesId") private LectureSeries lectureSeries; @ManyToOne @JoinColumn(name="lectureId") private Lecture lecture; private Long orderNum; } 위 테이블은 생성되는 조인테이블을 대체할 Entity 이다 // 강좌 시리즈 테이블 @Data @Entity @EqualsAndHashCode(of = "..
2023.06.28 -
Spring Boot + Thymeleaf Tag JAVA CUSTOM UTIL 사용
@Component public class CustomUtils { public static String removeTag(String html) throws Exception { return html.replaceAll("]*)?(\\s)*(/)?>", ""); } } 자바 Class 에 Component 추가 후 Thymeleaf 에서 이런 식으로 사용할 수 있다.
2023.06.27