Skip to content

Commit

Permalink
Merge pull request #15 from UdL-EPS-SoftArch/crud-ShelterCertificate-…
Browse files Browse the repository at this point in the history
…Relationship

ShelterCertificate Relationship
  • Loading branch information
elskater98 authored Mar 6, 2024
2 parents 61620ec + 9c353ae commit 52ca455
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package cat.udl.eps.softarch.demo.domain;

import com.fasterxml.jackson.annotation.JsonIdentityReference;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.OneToOne;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
Expand All @@ -12,6 +14,10 @@
@Entity
@EqualsAndHashCode(callSuper = false)
public class ShelterCertificate {
@OneToOne
@NotNull
@JsonIdentityReference(alwaysAsId = true)
private Shelter shelter;

@Id
private Long id;
Expand Down
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.ShelterCertificate;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface ShelterCertificateRepository extends CrudRepository<ShelterCertificate, String>, PagingAndSortingRepository<ShelterCertificate, String> {

}

0 comments on commit 52ca455

Please sign in to comment.