Skip to content

Commit

Permalink
Merge pull request #12 from UdL-EPS-SoftArch/crud-Schedule-relations
Browse files Browse the repository at this point in the history
Schedule relations added
  • Loading branch information
elskater98 authored Mar 6, 2024
2 parents 19bf1d0 + b259219 commit 61620ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package cat.udl.eps.softarch.demo.domain;


import com.fasterxml.jackson.annotation.JsonIdentityReference;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.validation.constraints.NotBlank;
import jakarta.persistence.ManyToOne;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
Expand All @@ -26,4 +27,8 @@ public class Schedule {
@NotNull
private Time endTime;

@ManyToOne
@NotNull
@JsonIdentityReference(alwaysAsId = true)
private Shelter shelter;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package cat.udl.eps.softarch.demo.repository;

import cat.udl.eps.softarch.demo.domain.Schedule;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface ScheduleRepository extends CrudRepository<Schedule, String>, PagingAndSortingRepository<Schedule, String> {

}

0 comments on commit 61620ec

Please sign in to comment.