feat: Add project entity (SCRUM-7) (!7)
Co-authored-by: Phan Huy Tran <p.tran@neusta.de> Reviewed-on: #7 Reviewed-by: Jan Gleytenhoover <krisellp9@gmail.com> Co-authored-by: Phan Huy Tran <ptran@noreply.localhost> Co-committed-by: Phan Huy Tran <ptran@noreply.localhost>
This commit is contained in:
parent
77f2b73085
commit
3bd8f0166a
41
src/main/java/de/szut/lf8_starter/project/ProjectEntity.java
Normal file
41
src/main/java/de/szut/lf8_starter/project/ProjectEntity.java
Normal file
@ -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<Long> employees;
|
||||||
|
|
||||||
|
private long contractor;
|
||||||
|
|
||||||
|
private String contractorName;
|
||||||
|
|
||||||
|
private String comment;
|
||||||
|
|
||||||
|
@CreatedDate
|
||||||
|
private LocalDate startDate;
|
||||||
|
|
||||||
|
private LocalDate endDate;
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
package de.szut.lf8_starter.project;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface ProjectRepository extends JpaRepository<ProjectEntity, Long> {
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user