1, problem
when I use the alias IDEA of the entity in Mapper.xml, there will be a red cross, while using full path will not report an error. is this IDEA"s problem? How to solve the problem?
2, my configuration
application.xml:
-sharp [Mybatis]
-sharp
mybatis.type-aliases-package=com.freedom.clothing.domain
DataSourceConfig.xml
@Bean
public SqlSessionFactory sqlSessionFactoryBean() throws Exception {
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(dataSource());
//
sqlSessionFactoryBean.setTypeAliasesPackage("com.freedom.clothing.domain");
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
// Mapper.xml
sqlSessionFactoryBean.setMapperLocations(resolver.getResources("classpath:/mapper/*.xml"));
return sqlSessionFactoryBean.getObject();
}
Match class
@Setter
@Getter
public class Match {
private Integer id;
private Integer userId;
private Integer groupId;
//
private List<MatchItem> matchItems;
//
private List<Tag> tags;
private Boolean isPublish;
private Boolean isDel;
public Integer getId() {
return id;
}
}