-
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 branch 'main' into CRUD-shelter
- Loading branch information
Showing
4 changed files
with
98 additions
and
11 deletions.
There are no files selected for viewing
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
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,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(); | ||
} | ||
|
||
} |
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,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(); | ||
} | ||
} |
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,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; | ||
|
||
} |