PMT-4: Mitarbeiter zu einem projekt hinzufügen #14

Merged
SZUT-Dominik merged 7 commits from story/PMT-4-mitarbeiter-zu-einem-projekt into trunk 2024-10-21 14:11:15 +00:00
3 changed files with 56 additions and 0 deletions
Showing only changes of commit 17e20ee830 - Show all commits

View file

@ -0,0 +1,34 @@
package de.hmmh.pmt.db;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import lombok.*;
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@Entity
@IdClass(AllocationId.class)
@Table(name = "allocation")
public class Allocation {
@Id
@Setter(AccessLevel.NONE)
private Long projectId;
@ManyToOne
@JoinColumn(name = "allocation_project", referencedColumnName = "id", insertable = false, updatable = false)
private Project project;
@Id
private Long employeeId;
@NotNull
private Long role; // This is a QualificationId
public void setProject(Project project) {
this.project = project;
this.projectId = project.getId();
}
}

View file

@ -0,0 +1,18 @@
package de.hmmh.pmt.db;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.io.Serializable;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class AllocationId implements Serializable {
private static final long serialVersionUID = 1L;
private Long projectId;
private Long employeeId;
}

View file

@ -4,6 +4,10 @@
<Class name="de.hmmh.pmt.employee.ApiClientFactory"/> <Class name="de.hmmh.pmt.employee.ApiClientFactory"/>
<Bug code="M,V,EI"/> <Bug code="M,V,EI"/>
</Match> </Match>
<Match>
<Class name="de.hmmh.pmt.db.Allocation"/>
<Bug code="M,V,EI,EI2"/>
</Match>
<Match> <Match>
<!--Ignore Auto Generated Code --> <!--Ignore Auto Generated Code -->
<Source name="~.*build/.*"/> <Source name="~.*build/.*"/>