26 lines
527 B
Java
26 lines
527 B
Java
package com.chantha.jdbc.jpa.model;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonManagedReference;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.Data;
|
|
import lombok.NoArgsConstructor;
|
|
|
|
import javax.persistence.*;
|
|
import java.util.List;
|
|
|
|
@Entity
|
|
@NoArgsConstructor
|
|
@AllArgsConstructor
|
|
@Data
|
|
public class Position {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
private String tittle;
|
|
|
|
@OneToMany(mappedBy = "position")
|
|
@JsonManagedReference
|
|
private List<Staff> staff;
|
|
}
|