Skip to content

Commit

Permalink
Merge pull request #5 from UdL-EPS-SoftArch/crud-Adoptions
Browse files Browse the repository at this point in the history
Adoptions class
  • Loading branch information
jorgechp authored Feb 27, 2024
2 parents 84a1913 + 74d8352 commit 179c4e3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions EntitiesModel.puml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Location "1" -> "1" Shelter : has>
Shelter "1" -> "*" User : < pertain
Shelter "1" -> "*" Pet : has >
Shelter "1" -> "1" ShelterCertificate : has >
Shelter "1" -- "*" Adoptions
Schedule "*" -> "1" Shelter :available >

Adoptions "1" -> "1" Pet :adopted >
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Adoptions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package cat.udl.eps.softarch.demo.domain;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;


@Setter
@Getter
@Entity
@Data
@EqualsAndHashCode (callSuper = false)

public class Adoptions {
@NotNull
@NotBlank
private LocalDateTime dateOfAdoption;
@Id
@GeneratedValue
private int id;

public Adoptions() {
this.dateOfAdoption = LocalDateTime.now();
}

}

0 comments on commit 179c4e3

Please sign in to comment.