PMT-32: Create Project Database Entity and Repository

This commit is contained in:
Dominik Säume 2024-09-25 11:16:52 +02:00
parent 45d6b51967
commit 13a8ee5d50
No known key found for this signature in database
GPG key ID: F5211AA345CF6871
2 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,37 @@
package de.hmmh.pmt.db;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@Entity
@Table(name = "project")
public final class Project {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotBlank
@Size(min = 3, max = 64)
private String name;
@NotNull
private LocalDateTime start;
@NotNull
private LocalDateTime plannedEnd;
private LocalDateTime end;
}

View file

@ -0,0 +1,6 @@
package de.hmmh.pmt.db;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ProjectRepository extends JpaRepository<Project, Long> {
}