Skip to content

Commit

Permalink
Merge pull request #36 from UdL-EPS-SoftArch/crud-sheltervolunteer
Browse files Browse the repository at this point in the history
ShelterVolunteer - Repository + relationships
  • Loading branch information
elskater98 authored Feb 29, 2024
2 parents 98dcfad + ed4918b commit 4bb739c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
package cat.udl.eps.softarch.demo.domain;

public class ShelterVolunteer extends User {
import com.fasterxml.jackson.annotation.JsonIdentityReference;
import jakarta.persistence.Entity;
import jakarta.persistence.ManyToOne;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
@Entity
public class ShelterVolunteer extends User {
@JsonIdentityReference(alwaysAsId = true)
@ManyToOne
private Shelter userShelter;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package cat.udl.eps.softarch.demo.repository;

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

public interface ShelterVolunteerRepository extends CrudRepository<ShelterVolunteer, String>, PagingAndSortingRepository<ShelterVolunteer, String> {
}

0 comments on commit 4bb739c

Please sign in to comment.