title : "SpringBoot- SpringBoot JPA"
category : "SpringBoot"
tags : [SpringBoot,JPA]
date : 2022-01-23T12:00:00
last_modified_at: 2022-01-23T12:00:00
SpringBoot JPA
JPA
- java 표준
ORM(Object Relational Mapping)
- 자바와 데이터베이스의
패러다임
을 일치 시켜주기 위한 기술 - SQL종속적인 개발에서 벗어나게 함
JPA Adjusting
- 엔티티의 수정, 생성시간 관리
@Getter
@MappedSuperclass // JPA Entity 클래스들이 BaseTimeEntity 를 상속할 경우 필드들을 컬럼으로 인식하도록 함
@EntityListeners(AuditingEntityListener.class) // 이 클래스에 JPAAuditing 기능 포함
public class BaseTimeEntity {
@CreatedDate // Entity 가 생성되어 저장될 때 시간이 자동 저장 됩니다.
private LocalDateTime createdDate;
@LastModifiedDate
private LocalDateTime modifiedDate;
}
https://hy1116.github.io/springboot/springbootjpa/
SpringBoot- SpringBoot JPA
SpringBoot JPA
hy1116.github.io
'Spring > SpringBoot' 카테고리의 다른 글
[SpringBoot] Interceptor 설정하기 (0) | 2024.03.21 |
---|---|
[SpringBoot] @WithSecurityContext 커스텀하기 (0) | 2024.03.20 |
[Spring Boot] @ConfigurationProperties (0) | 2024.03.15 |
[Spring Boot] Spring Security 6버전 셋팅 (0) | 2024.03.12 |
[SpringBoot] Gradle 설정 (0) | 2023.03.08 |