-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5110fb0
commit e0853e3
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
backend/pium/src/main/java/com/official/pium/domain/History.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.official.pium.domain; | ||
|
||
import jakarta.persistence.*; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalDate; | ||
|
||
@Entity | ||
@Getter | ||
@Table(name = "history") | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class History extends BaseEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@NotNull | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "pet_plant_id", nullable = false) | ||
private PetPlant petPlant; | ||
|
||
@NotNull | ||
@Column(name = "water_date", nullable = false) | ||
private LocalDate waterDate; | ||
|
||
@Builder | ||
private History(@NotNull PetPlant petPlant, @NotNull LocalDate waterDate) { | ||
this.petPlant = petPlant; | ||
this.waterDate = waterDate; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters