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

Added new class Shelter #4

Merged
merged 7 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion EntitiesModel.puml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Cat extends Pet {
meowingLevel: Integer
}

class Shelter {
class Shelter extends UriEntity{
id: Integer
name: String
email: String
Expand Down
44 changes: 44 additions & 0 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package cat.udl.eps.softarch.demo.domain;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import lombok.Data;
import jakarta.persistence.Id;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jdk.jfr.BooleanFlag;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;

@Entity
@Data
@EqualsAndHashCode(callSuper = false)
public class Shelter extends UriEntity<String> {
PauMAVA marked this conversation as resolved.
Show resolved Hide resolved

@Id
private String id;

@NotBlank
private String name;

@NotBlank
@Email
@Column(unique = true)
private String email;

@NotBlank
@Length(min=12, max=12)
private String mobile;

@NotBlank
private LocalDateTime createdAt;

@NotBlank
private LocalDateTime updatedAt;

@BooleanFlag
private boolean isActive;

}
Loading