-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from UdL-EPS-SoftArch/crud-sheltervolunteer
ShelterVolunteer - Repository + relationships
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
13 changes: 12 additions & 1 deletion
13
src/main/java/cat/udl/eps/softarch/demo/domain/ShelterVolunteer.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 |
---|---|---|
@@ -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; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/cat/udl/eps/softarch/demo/repository/ShelterVolunteerRepository.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,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> { | ||
} |