From 3bd8f0166a9649b99aaaae09528401ca5c882798 Mon Sep 17 00:00:00 2001 From: Phan Huy Tran Date: Wed, 25 Sep 2024 09:33:42 +0000 Subject: [PATCH] feat: Add project entity (SCRUM-7) (!7) Co-authored-by: Phan Huy Tran Reviewed-on: https://git.kjan.de/jank/LF8/pulls/7 Reviewed-by: Jan Gleytenhoover Co-authored-by: Phan Huy Tran Co-committed-by: Phan Huy Tran --- .../lf8_starter/project/ProjectEntity.java | 41 +++++++++++++++++++ .../project/ProjectRepository.java | 6 +++ 2 files changed, 47 insertions(+) create mode 100644 src/main/java/de/szut/lf8_starter/project/ProjectEntity.java create mode 100644 src/main/java/de/szut/lf8_starter/project/ProjectRepository.java diff --git a/src/main/java/de/szut/lf8_starter/project/ProjectEntity.java b/src/main/java/de/szut/lf8_starter/project/ProjectEntity.java new file mode 100644 index 0000000..6596350 --- /dev/null +++ b/src/main/java/de/szut/lf8_starter/project/ProjectEntity.java @@ -0,0 +1,41 @@ +package de.szut.lf8_starter.project; + +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.springframework.data.annotation.CreatedDate; + +import java.time.LocalDate; +import java.util.List; + +@NoArgsConstructor +@AllArgsConstructor +@Getter +@Setter +@Entity +@Table(name = "projects") +public class ProjectEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private long id; + + private String name; + + private long leadingEmployee; + + @ElementCollection + private List employees; + + private long contractor; + + private String contractorName; + + private String comment; + + @CreatedDate + private LocalDate startDate; + + private LocalDate endDate; +} diff --git a/src/main/java/de/szut/lf8_starter/project/ProjectRepository.java b/src/main/java/de/szut/lf8_starter/project/ProjectRepository.java new file mode 100644 index 0000000..9798fc8 --- /dev/null +++ b/src/main/java/de/szut/lf8_starter/project/ProjectRepository.java @@ -0,0 +1,6 @@ +package de.szut.lf8_starter.project; + +import org.springframework.data.jpa.repository.JpaRepository; + +public interface ProjectRepository extends JpaRepository { +}