注入mapper、dao等實體類報錯

明明有卻無效,別慌!在mapper層加一行@Repository就搞定了! Spring的註解形式:@Repository、@Service、@Controller,它們分別對應存儲層Bean,業務層Bean,和展示層Bean。 @Component 將類標識爲Bean(可代表所有bean類,包括:@Repository、@Service、@Controller)
相關文章
相關標籤/搜索