dao里面加入findByExample方法

public List findByExample(Class entityClass) {   
    log.debug("finding instance by example");    
    try {    
        Example example = Example.create(entityClass).ignoreCase().enableLike(MatchMode.ANYWHERE);    
        List results = findByExample(example ,entityClass);   
        log.debug("find by example successful, result size: " + results.size()); return results;    
    } catch (RuntimeException re) {    
        log.error("find by example failed", re); throw re;    
    }   
}  

你可能感兴趣的:(java,DAO)