Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crud-Favourite #72

Merged
merged 18 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a255eef
created Favourite endpoint for the ManyToMany "favouritedBy" relation
Antt02 Mar 13, 2024
bfcfa25
created Favourite endpoint for the ManyToMany "favouritedBy" relation
Antt02 Mar 13, 2024
95dd929
Merge remote-tracking branch 'origin/crud-Favourite' into crud-Favourite
Antt02 Mar 13, 2024
af40c7e
checking if failure comes from pushing repository and base class at t…
Antt02 Mar 19, 2024
7467bb0
checking if failure comes from pushing repository and base class at t…
Antt02 Mar 19, 2024
3a71038
Merge remote-tracking branch 'origin/crud-Favourite' into crud-Favourite
Antt02 Mar 19, 2024
13f10a7
fixing favourite implementation
Antt02 Mar 19, 2024
d40a3c4
fixing favourite implementation
Antt02 Mar 19, 2024
a2361ed
Merge remote-tracking branch 'origin/crud-Favourite' into crud-Favourite
Antt02 Mar 19, 2024
4194436
Merge remote-tracking branch 'origin/crud-Favourite' into crud-Favourite
Antt02 Mar 19, 2024
2bf1d01
Merge remote-tracking branch 'origin/crud-Favourite' into crud-Favourite
Antt02 Mar 19, 2024
b354df2
fixing favourite implementation
Antt02 Mar 19, 2024
babd753
Merge remote-tracking branch 'origin/crud-Favourite' into crud-Favourite
Antt02 Mar 19, 2024
bc94d30
Merge branch 'main' into crud-Favourite
Antt02 Apr 2, 2024
293eea9
implementing favourite pets as one to many
Antt02 Apr 2, 2024
32eac35
implementing favourite pets as one to many
Antt02 Apr 2, 2024
9a62e63
Merge remote-tracking branch 'origin/crud-Favourite' into crud-Favourite
Antt02 Apr 2, 2024
5b79590
local tests working now
Antt02 Apr 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions EntitiesModel.puml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ class MedicalRecord {
date : Date
}

class FavouritedPets {
id : Long
petId : Long
}


Pet "1" -- "*" MedicalRecord : has >

Expand All @@ -104,4 +109,5 @@ Client "*" -> "*" Shelter : donate >
Adoption "*" -> "1" Pet :adopted >
Adoption "*" -> "1" User :adopt <
ShelterVolunteer "1.*" -> "*" Shelter : works >
User "1" -> "*" FavouritedPets : hasFavourited >
@enduml
18 changes: 18 additions & 0 deletions src/main/java/cat/udl/eps/softarch/demo/domain/FavouritedPets.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cat.udl.eps.softarch.demo.domain;

import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Entity
@Data
public class FavouritedPets extends UriEntity<Long> {
@Id
@NotNull
Long id;

Long petId;
}
8 changes: 3 additions & 5 deletions src/main/java/cat/udl/eps/softarch/demo/domain/User.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package cat.udl.eps.softarch.demo.domain;

import com.fasterxml.jackson.annotation.JsonProperty;

import com.fasterxml.jackson.annotation.JsonValue;
import jakarta.persistence.*;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
Expand Down Expand Up @@ -77,7 +75,7 @@ public boolean isEnabled() {
return true;
}

@ManyToMany
public List<Pet> favouritedPets;
@OneToMany(fetch = FetchType.EAGER)
public List<FavouritedPets> favouritedPets;

}
Loading