feat: Add project entity (SCRUM-7) #7

Merged
jank merged 1 commits from feature/create-project into main 2024-09-25 09:33:42 +00:00
2 changed files with 47 additions and 0 deletions

@ -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> {
}