Spring - 순수 JPA와 DTO를 이용한 게시판 예제
아래는 순수 JPA와 DTO, Repository, Service, Entity를 이용한 간단한 게시판 예제입니다. DTO (Data Transfer Object): public class PostDTO { private Long id; private String title; private String content; // Getter and Setter } Entity: @Entity @Table(name = "posts") public class Post { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(nullable = false) private String title; @Column(nullable..
웹/Spring
2023. 6. 7. 15:50