mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-12-27 10:57:28 +00:00
Merge 254f2e5d5c into fd4361b118
This commit is contained in:
commit
70a5d7c970
1 changed files with 3 additions and 1 deletions
|
|
@ -20,6 +20,7 @@ import java.util.Collection;
|
|||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.samples.petclinic.model.NamedEntity;
|
||||
|
||||
|
|
@ -45,12 +46,13 @@ import jakarta.persistence.Table;
|
|||
@Table(name = "pets")
|
||||
public class Pet extends NamedEntity {
|
||||
|
||||
@Column
|
||||
@NotNull(message = "Birth date is required")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate birthDate;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "type_id")
|
||||
|
||||
private PetType type;
|
||||
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue