spring+ibatis的dao接口 能使用内部类吗?
spring扫描xml加载的
要怎么配置?
现在加载不到namespace指定的内部类
public interface MissionTypeMatterMapper {
int deleteByPrimaryKey(Integer mission_matter_id);
void insert(MissionTypeMatter record);
List<MissionType> selectByPrimaryKey(Integer mission_matter_id);
List<MissionMatter> selectByMatterType(@Param("mission_matter_id") Integer mission_matter_id,
@Param("matter_type_id") Integer matter_type_id);
List<MissionMatter> missionMatterList(MatterSearchOption keyword);
Integer countMissionMatter(MatterSearchOption keyword);
public interface EquipmentTypeMatterMapper extends MissionTypeMatterMapper {
}
public interface SecurityTypeMatterMapper extends MissionTypeMatterMapper {
}
}
接口 EquipmentTypeMatterMapper、SecurityTypeMatterMapper 有对应的xml文件,但无法实例化
你定义的内部类本来就不适合外部访问吧?这个和Spring没啥关系,是否可以换一个实现方式
内部类使用的时候依赖于外部宿主对象的。你为什么要用内部类呢?
多个xml映射文件,方法相同,想写在一个接口里,并继承父接口