JPA merge table

143 Views Asked by At

I have table employee

@Entity
@Table(name = "employee")
public class Employee {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="emp_id")
    private Long id;
    
    @Column(name="emp_name")
    private String empName;
    
    @Column(name="emp_mail")
    private String empMail;
    
    @Column(name="emp_no")
    private String empNo;

    @Column(name="emp_salary")
    private Long empSalary;
    
    @Column(name="type_id")
    private Long typeId;

}

In addition, I have table employeetype whose primary key type id is in employee table enter image description here

How i am able to get response containg type_name not type_id in java data jpa for api using jparepository. how to join table data.

0

There are 0 best solutions below