Search in sources :

Example 1 with ConnectionFactory

use of org.mybatis.generator.api.ConnectionFactory in project generator by mybatis.

the class ObjectFactory method createConnectionFactory.

public static ConnectionFactory createConnectionFactory(Context context) {
    ConnectionFactoryConfiguration config = context.getConnectionFactoryConfiguration();
    ConnectionFactory answer;
    String type;
    if (config == null || config.getConfigurationType() == null) {
        type = JDBCConnectionFactory.class.getName();
    } else {
        type = config.getConfigurationType();
    }
    answer = (ConnectionFactory) createInternalObject(type);
    if (config != null) {
        answer.addConfigurationProperties(config.getProperties());
    }
    return answer;
}
Also used : ConnectionFactory(org.mybatis.generator.api.ConnectionFactory) Messages.getString(org.mybatis.generator.internal.util.messages.Messages.getString) ConnectionFactoryConfiguration(org.mybatis.generator.config.ConnectionFactoryConfiguration)

Aggregations

ConnectionFactory (org.mybatis.generator.api.ConnectionFactory)1 ConnectionFactoryConfiguration (org.mybatis.generator.config.ConnectionFactoryConfiguration)1 Messages.getString (org.mybatis.generator.internal.util.messages.Messages.getString)1