Skip to content

Commit

Permalink
Multiple fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LordDangerous committed Mar 7, 2024
1 parent 71f7841 commit 302a739
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 30 deletions.
7 changes: 2 additions & 5 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Adoptions.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package cat.udl.eps.softarch.demo.domain;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.OneToOne;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
Expand All @@ -22,7 +19,7 @@
public class Adoptions {

@Id
@GeneratedValue
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@OneToOne
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cat.udl.eps.softarch.demo.domain;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
Expand All @@ -13,6 +15,7 @@
public class Permission {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@NotNull
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Pet.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package cat.udl.eps.softarch.demo.domain;

import com.fasterxml.jackson.annotation.JsonIdentityReference;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToOne;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
Expand All @@ -22,6 +19,7 @@
public abstract class Pet extends UriEntity<Long> {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@NotBlank
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Role.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package cat.udl.eps.softarch.demo.domain;

import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
Expand All @@ -14,7 +12,8 @@
public class Role extends UriEntity<String> {

@Id
private String id;
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@NotBlank
private String name;
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Schedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@


import com.fasterxml.jackson.annotation.JsonIdentityReference;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
Expand All @@ -18,7 +15,7 @@
public class Schedule {

@Id
@GeneratedValue
@GeneratedValue(strategy = GenerationType.AUTO)
private int Id;

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class Shelter extends UriEntity<Long> {
private ShelterCertificate shelterCertificate;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@NotBlank
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
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.persistence.*;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
Expand All @@ -20,6 +18,7 @@ public class ShelterCertificate {
private Shelter shelter;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import cat.udl.eps.softarch.demo.domain.Adoptions;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

public interface AdoptionsRepository extends CrudRepository<Adoptions, String>, PagingAndSortingRepository<Adoptions, String> {
@RepositoryRestResource
public interface AdoptionsRepository extends CrudRepository<Adoptions, Long>, PagingAndSortingRepository<Adoptions, Long> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import cat.udl.eps.softarch.demo.domain.Cat;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

public interface CatRepository extends CrudRepository<Cat, String>, PagingAndSortingRepository<Cat, String> {
@RepositoryRestResource
public interface CatRepository extends CrudRepository<Cat, Long>, PagingAndSortingRepository<Cat, Long> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import cat.udl.eps.softarch.demo.domain.Dog;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

public interface DogRepository extends CrudRepository<Dog, String>, PagingAndSortingRepository<Dog, String> {
@RepositoryRestResource
public interface DogRepository extends CrudRepository<Dog, Long>, PagingAndSortingRepository<Dog, Long> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import cat.udl.eps.softarch.demo.domain.User;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

public interface LocationRepository extends CrudRepository<Location, String>, PagingAndSortingRepository<Location, String> {
@RepositoryRestResource
public interface LocationRepository extends CrudRepository<Location, Long>, PagingAndSortingRepository<Location, Long> {


}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import cat.udl.eps.softarch.demo.domain.Pet;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

public interface PetRepository extends CrudRepository<Pet, String>, PagingAndSortingRepository<Pet, String> {
@RepositoryRestResource
public interface PetRepository extends CrudRepository<Pet, Long>, PagingAndSortingRepository<Pet, Long> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import cat.udl.eps.softarch.demo.domain.Schedule;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

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

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import cat.udl.eps.softarch.demo.domain.ShelterCertificate;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

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

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import cat.udl.eps.softarch.demo.domain.Shelter;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

@RepositoryRestResource
public interface ShelterRepository extends CrudRepository<Shelter, Long>, PagingAndSortingRepository<Shelter, Long> {

public interface ShelterRepository extends CrudRepository<Shelter, String>, PagingAndSortingRepository<Shelter, String> {
Shelter findName(String name);
}

0 comments on commit 302a739

Please sign in to comment.