Hibernate/Spring的findByExample

Java代码 
  1. Class User{  
  2.     String username;  
  3.     String password = "默认口令";  
  4.     Company company;  
  5.     getter()&setter().....  
  6. }  


Java代码 
  1. Company company = companyDao.getById("id");  
  2. User user = new User();  
  3. user.setSid("主键");  
  4. uer.setUsername("user");  
  5. use.setCompany(company);  
  6. userDao.findByExample(user);  

这个时候的SQL条件为: 
Sql代码 
  1. select * from user  
  2. where username = ?  
  3. and password = ?  


findByExample()使用时得出结论: 
1.不支持主键 
2.不支持关联 
3.不支持NULL 
引用
Version properties, identifiers and associations are ignored. By default, null valued properties are excluded

你可能感兴趣的:(java,properties,user,null,setter,associations)