Skip to content

Commit

Permalink
了解 mbatis association的应用,和级联查询有不同
Browse files Browse the repository at this point in the history
  • Loading branch information
herylee committed Jun 10, 2019
1 parent 4273aa7 commit 72fe061
Show file tree
Hide file tree
Showing 7 changed files with 674 additions and 416 deletions.
22 changes: 21 additions & 1 deletion ssm-crud/src/main/java/com/atguigu/crud/bean/Employee.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,27 @@ public class Employee {

private Integer dId;

public Integer getEmpId() {
//查询员工的同时,部门信息也是查询好的
private Department department;




/**
* @return the department
*/
public Department getDepartment() {
return department;
}

/**
* @param department the department to set
*/
public void setDepartment(Department department) {
this.department = department;
}

public Integer getEmpId() {
return empId;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ public interface EmployeeMapper {
List<Employee> selectByExample(EmployeeExample example);

Employee selectByPrimaryKey(Integer empId);


List<Employee> selectByExampleWithDept(EmployeeExample example);

Employee selectByPrimaryKeyWithDept(Integer empId);




int updateByExampleSelective(@Param("record") Employee record, @Param("example") EmployeeExample example);

Expand Down
Loading

0 comments on commit 72fe061

Please sign in to comment.