Skip to content

Commit

Permalink
Merge branch 'main' into CRUD-shelter
Browse files Browse the repository at this point in the history
  • Loading branch information
LordDangerous authored Feb 27, 2024
2 parents b9f8bce + 70074b7 commit f6f4748
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 11 deletions.
22 changes: 11 additions & 11 deletions EntitiesModel.puml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ class User extends UriEntity implements UserDetails {
class UriEntity {
uri : String
}
abstract class Pet{
id: Integer
abstract class Pet extends UriEntity {
id: Long
name: String
dateOfBirth: String
dateOfBirth: Date
isAdopted: Boolean
colour: String
size: Integer
chip: Integer
chip: String
sex: String
race: String
dangerous: Boolean
Expand All @@ -31,8 +31,8 @@ class Cat extends Pet {
meowingLevel: Integer
}

class Shelter extends UriEntity{
id: Integer
class Shelter extends UriEntity {
id: Long
name: String
email: String
mobile : String
Expand All @@ -42,7 +42,7 @@ class Shelter extends UriEntity{
}

class Location {
id: Integer
id: Long
address: String
latitude: Float
longitude: Float
Expand All @@ -52,12 +52,12 @@ class Location {
}

class ShelterCertificate {
id: String
id: Long
expirationDate: DateTime
}

class Schedule {
id: Integer
id: Long
startTime: Time
endTime: Time
}
Expand All @@ -67,12 +67,12 @@ class Adoptions {
}

class Role {
id: Integer
id: Long
name: String
}

class Permission {
id: Integer
id: Long
name: String
}

Expand Down
23 changes: 23 additions & 0 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Cat.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package cat.udl.eps.softarch.demo.domain;

import jakarta.persistence.Entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Entity
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class Cat extends Pet {

private Integer meowingLevel;

@Override
public Long getId() {
return super.getId();
}

}
22 changes: 22 additions & 0 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Dog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package cat.udl.eps.softarch.demo.domain;

import jakarta.persistence.Entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Entity
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class Dog extends Pet {

private Integer barkingLevel;

@Override
public Long getId() {
return super.getId();
}
}
42 changes: 42 additions & 0 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Pet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package cat.udl.eps.softarch.demo.domain;

import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.time.LocalDate;

@Entity
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
public abstract class Pet extends UriEntity<Long> {

@Id
private Long id;

@NotBlank
private String name;

private LocalDate dateOfBirth;

private boolean isAdopted;

private String colour;

private Integer size;

private String chip;

private String sex;

private String race;

private boolean dangerous;

}

0 comments on commit f6f4748

Please sign in to comment.