Example usage for org.apache.ibatis.session Configuration getMapperRegistry

List of usage examples for org.apache.ibatis.session Configuration getMapperRegistry

Introduction

In this page you can find the example usage for org.apache.ibatis.session Configuration getMapperRegistry.

Prototype

public MapperRegistry getMapperRegistry() 

Source Link

Usage

From source file:org.neo4j.jdbc.example.mybatis.MybatisTest.java

License:Apache License

protected void buildMybatisConfiguration(String protocol, String host, int port) {
    DataSource dataSource = new UnpooledDataSource("org.neo4j.jdbc.Driver",
            "jdbc:neo4j:" + protocol + "://" + host + ":" + port + "?noSsl", null);
    TransactionFactory transactionFactory = new JdbcTransactionFactory();
    Environment environment = new Environment("development", transactionFactory, dataSource);

    Configuration configuration = new Configuration(environment);
    configuration.getMapperRegistry().addMapper(ActorMapper.class);
    configuration.addLoadedResource("org/neo4j/jdbc/example/mybatis/mapper/ActorMapper.xml");

    ConnectionFactory.getSqlSessionFactory(configuration);
}