package pl.morecraft.dev.stm.domain;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import pl.morecraft.dev.stm.domain.dictionary.WorkStatus;

import javax.persistence.*;

@Entity
@Table(name = "mod_work")
@Inheritance(strategy = InheritanceType.JOINED)
@Getter
@Setter
@NoArgsConstructor
public abstract class Work extends PrivilegeObject {

    private String name;
    private String subject;
    private String description;

    @Enumerated(EnumType.STRING)
    private WorkStatus status;
    //lista kategorii
}

@@ -194,16 +194,39 @@
 tence.*;
+%0Aimport java.util.List;
 %0A%0A@Entit
@@ -544,28 +544,301 @@
 us;%0A
-    //lista kategorii
+%0A%0A    @ManyToMany%0A    @JoinTable(name = %22mod_work_category%22,%0A            joinColumns = %7B@JoinColumn(name = %22mod_work_id%22, referencedColumnName = %22id%22)%7D,%0A            inverseJoinColumns = %7B@JoinColumn(name = %22mod_category_id%22, referencedColumnName = %22id%22)%7D)%0A    private List%3CCategory%3E categories;
 %0A%7D%0A

Work model extended with Category List