Class User{
String username;
String password = "默认口令";
Company company;
getter()&setter()..... }
Company company = companyDao.getById("id");
User user = new User();
user.setSid("主键");
uer.setUsername("user");
use.setCompany(company); userDao.findByExample(user);
这个时候的后台打印SQL语句为:
select * from user
where username = ?
and password = ?
结论:findByExample
1.不支持主键2.不支持关联
3.不支持NULL