@Setter, @Getter (Lombok 라이브러리 어노테이션)
: 자바 클래스에서 필드마다 직접 getXXX(), setXXX() 메서드를 작성하지 않고,
자동으로 Getter/Setter 메서드를 생성해주는 어노테이션.
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class MusicBean {
private String title;
private String Singer;
private int price;
}
🔽실행 오류시
pom.xml에 <bulid> 부분 아래코드로 교체
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
'기초 및 언어 > ▶ Spring' 카테고리의 다른 글
| 05. Spring_유효성검사 (0) | 2025.09.21 |
|---|---|
| 04. Spring MVC에서 데이터 전달하기 (1) | 2025.09.19 |
| 02. Spring_import가 안될때 (0) | 2025.09.19 |
| 01. Spring_기초, 출력하기 (1) | 2025.09.18 |
| 00. 인텔리제이_설치 및 프로젝트 생성 (0) | 2025.09.18 |