package com.jy.framework.mybatis.join;

import jakarta.annotation.Resource;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.mapper.MapperFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JoinConfig {

    @Resource
    private SqlSessionFactory sqlSessionFactory;

    @Bean
    public MapperFactoryBean<JoinMapper> joinMapper() {
        MapperFactoryBean<JoinMapper> mapperFactoryBean = new MapperFactoryBean<>();
        mapperFactoryBean.setSqlSessionFactory(sqlSessionFactory);
        mapperFactoryBean.setMapperInterface(JoinMapper.class);
        return mapperFactoryBean;
    }

}
