Example usage for org.apache.ibatis.reflection.factory ObjectFactory setProperties

List of usage examples for org.apache.ibatis.reflection.factory ObjectFactory setProperties

Introduction

In this page you can find the example usage for org.apache.ibatis.reflection.factory ObjectFactory setProperties.

Prototype

default void setProperties(Properties properties) 

Source Link

Document

Sets configuration properties.

Usage

From source file:cc.oit.dao.impl.mybatis.session.XMLConfigBuilder.java

License:Apache License

private void objectFactoryElement(XNode context) throws Exception {
    if (context != null) {
        String type = context.getStringAttribute("type");
        Properties properties = context.getChildrenAsProperties();
        ObjectFactory factory = (ObjectFactory) resolveClass(type).newInstance();
        factory.setProperties(properties);
        configuration.setObjectFactory(factory);
    }//from   w  w w  . j  av a 2  s.c o m
}

From source file:com.ibatis.sqlmap.engine.builder.XmlSqlMapConfigParser.java

License:Apache License

@NodeEvent("/sqlMapConfig/resultObjectFactory")
public void sqlMapConfigresultObjectFactory(XNode context) throws Exception {
    String type = context.getStringAttribute("type");
    Class factoryClass = Class.forName(type);
    ObjectFactory factory = (ObjectFactory) factoryClass.newInstance();
    Properties props = context.getChildrenAsProperties();
    factory.setProperties(props);
    config.setObjectFactory(factory);//  www .j a v a 2 s.com
}