- 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
引用
Version properties, identifiers and associations are ignored. By default, null valued properties are excluded
本文探讨了Java中通过示例对象查询数据的方法findByExample的具体用法及其限制,包括不支持主键查询、关联查询和NULL值处理的问题。

1万+

被折叠的 条评论
为什么被折叠?



