本文整理汇总了Java中org.apache.ibatis.scripting.xmltags.XMLLanguageDriver类的典型用法代码示例。如果您正苦于以下问题:Java XMLLanguageDriver类的具体用法?Java XMLLanguageDriver怎么用?Java XMLLanguageDriver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMLLanguageDriver类属于org.apache.ibatis.scripting.xmltags包,在下文中一共展示了XMLLanguageDriver类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Configuration
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; //导入依赖的package包/类
public Configuration() {
typeAliasRegistry.registerAlias("JDBC", JdbcTransactionFactory.class);
typeAliasRegistry.registerAlias("MANAGED", ManagedTransactionFactory.class);
typeAliasRegistry.registerAlias("JNDI", JndiDataSourceFactory.class);
typeAliasRegistry.registerAlias("POOLED", PooledDataSourceFactory.class);
typeAliasRegistry.registerAlias("UNPOOLED", UnpooledDataSourceFactory.class);
typeAliasRegistry.registerAlias("PERPETUAL", PerpetualCache.class);
typeAliasRegistry.registerAlias("FIFO", FifoCache.class);
typeAliasRegistry.registerAlias("LRU", LruCache.class);
typeAliasRegistry.registerAlias("SOFT", SoftCache.class);
typeAliasRegistry.registerAlias("WEAK", WeakCache.class);
typeAliasRegistry.registerAlias("DB_VENDOR", VendorDatabaseIdProvider.class);
typeAliasRegistry.registerAlias("XML", XMLLanguageDriver.class);
typeAliasRegistry.registerAlias("RAW", RawLanguageDriver.class);
typeAliasRegistry.registerAlias("SLF4J", Slf4jImpl.class);
typeAliasRegistry.registerAlias("COMMONS_LOGGING", JakartaCommonsLoggingImpl.class);
typeAliasRegistry.registerAlias("LOG4J", Log4jImpl.class);
typeAliasRegistry.registerAlias("LOG4J2", Log4j2Impl.class);
typeAliasRegistry.registerAlias("JDK_LOGGING", Jdk14LoggingImpl.class);
typeAliasRegistry.registerAlias("STDOUT_LOGGING", StdOutImpl.class);
typeAliasRegistry.registerAlias("NO_LOGGING", NoLoggingImpl.class);
typeAliasRegistry.registerAlias("CGLIB", CglibProxyFactory.class);
typeAliasRegistry.registerAlias("JAVASSIST", JavassistProxyFactory.class);
languageRegistry.setDefaultDriverClass(XMLLanguageDriver.class);
languageRegistry.register(RawLanguageDriver.class);
}
示例2: shouldSuccessfullyLoadMinimalXMLConfigFile
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; //导入依赖的package包/类
@Test
public void shouldSuccessfullyLoadMinimalXMLConfigFile() throws Exception {
String resource = "org/apache/ibatis/builder/MinimalMapperConfig.xml";
InputStream inputStream = Resources.getResourceAsStream(resource);
XMLConfigBuilder builder = new XMLConfigBuilder(inputStream);
Configuration config = builder.parse();
assertNotNull(config);
assertThat(config.getAutoMappingBehavior(), is(AutoMappingBehavior.PARTIAL));
assertThat(config.getAutoMappingUnknownColumnBehavior(), is(AutoMappingUnknownColumnBehavior.NONE));
assertThat(config.isCacheEnabled(), is(true));
assertThat(config.getProxyFactory(), is(instanceOf(JavassistProxyFactory.class)));
assertThat(config.isLazyLoadingEnabled(), is(false));
assertThat(config.isAggressiveLazyLoading(), is(true));
assertThat(config.isMultipleResultSetsEnabled(), is(true));
assertThat(config.isUseColumnLabel(), is(true));
assertThat(config.isUseGeneratedKeys(), is(false));
assertThat(config.getDefaultExecutorType(), is(ExecutorType.SIMPLE));
assertNull(config.getDefaultStatementTimeout());
assertNull(config.getDefaultFetchSize());
assertThat(config.isMapUnderscoreToCamelCase(), is(false));
assertThat(config.isSafeRowBoundsEnabled(), is(false));
assertThat(config.getLocalCacheScope(), is(LocalCacheScope.SESSION));
assertThat(config.getJdbcTypeForNull(), is(JdbcType.OTHER));
assertThat(config.getLazyLoadTriggerMethods(), is((Set<String>) new HashSet<String>(Arrays.asList("equals", "clone", "hashCode", "toString"))));
assertThat(config.isSafeResultHandlerEnabled(), is(true));
assertThat(config.getDefaultScriptingLanuageInstance(), is(instanceOf(XMLLanguageDriver.class)));
assertThat(config.isCallSettersOnNulls(), is(false));
assertNull(config.getLogPrefix());
assertNull(config.getLogImpl());
assertNull(config.getConfigurationFactory());
}
示例3: Configuration
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; //导入依赖的package包/类
public Configuration() {
// 源码解析: 注册事务工厂别名
typeAliasRegistry.registerAlias("JDBC", JdbcTransactionFactory.class);
typeAliasRegistry.registerAlias("MANAGED", ManagedTransactionFactory.class);
// 源码解析: 注册数据源工厂别名
typeAliasRegistry.registerAlias("JNDI", JndiDataSourceFactory.class);
typeAliasRegistry.registerAlias("POOLED", PooledDataSourceFactory.class);
typeAliasRegistry.registerAlias("UNPOOLED", UnpooledDataSourceFactory.class);
// 源码解析: 注册缓存别名
typeAliasRegistry.registerAlias("PERPETUAL", PerpetualCache.class);
typeAliasRegistry.registerAlias("FIFO", FifoCache.class);
typeAliasRegistry.registerAlias("LRU", LruCache.class);
typeAliasRegistry.registerAlias("SOFT", SoftCache.class);
typeAliasRegistry.registerAlias("WEAK", WeakCache.class);
// 源码解析: 注册VendorDatabaseIdProvider别名
typeAliasRegistry.registerAlias("DB_VENDOR", VendorDatabaseIdProvider.class);
// 源码解析: 注册LanguageDriver别名
typeAliasRegistry.registerAlias("XML", XMLLanguageDriver.class);
typeAliasRegistry.registerAlias("RAW", RawLanguageDriver.class);
// 源码解析: 注册日志实现别名
typeAliasRegistry.registerAlias("SLF4J", Slf4jImpl.class);
typeAliasRegistry.registerAlias("COMMONS_LOGGING", JakartaCommonsLoggingImpl.class);
typeAliasRegistry.registerAlias("LOG4J", Log4jImpl.class);
typeAliasRegistry.registerAlias("LOG4J2", Log4j2Impl.class);
typeAliasRegistry.registerAlias("JDK_LOGGING", Jdk14LoggingImpl.class);
typeAliasRegistry.registerAlias("STDOUT_LOGGING", StdOutImpl.class);
typeAliasRegistry.registerAlias("NO_LOGGING", NoLoggingImpl.class);
// 源码解析: 注册代理工厂别名
typeAliasRegistry.registerAlias("CGLIB", CglibProxyFactory.class);
typeAliasRegistry.registerAlias("JAVASSIST", JavassistProxyFactory.class);
languageRegistry.setDefaultDriverClass(XMLLanguageDriver.class);
languageRegistry.register(RawLanguageDriver.class);
}
示例4: Configuration
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; //导入依赖的package包/类
public Configuration() {
typeAliasRegistry.registerAlias("JDBC", JdbcTransactionFactory.class);
typeAliasRegistry.registerAlias("MANAGED",
ManagedTransactionFactory.class);
typeAliasRegistry.registerAlias("JNDI", JndiDataSourceFactory.class);
typeAliasRegistry
.registerAlias("POOLED", PooledDataSourceFactory.class);
typeAliasRegistry.registerAlias("UNPOOLED",
UnpooledDataSourceFactory.class);
typeAliasRegistry.registerAlias("PERPETUAL", PerpetualCache.class);
typeAliasRegistry.registerAlias("FIFO", FifoCache.class);
typeAliasRegistry.registerAlias("LRU", LruCache.class);
typeAliasRegistry.registerAlias("SOFT", SoftCache.class);
typeAliasRegistry.registerAlias("WEAK", WeakCache.class);
typeAliasRegistry.registerAlias("DB_VENDOR",
VendorDatabaseIdProvider.class);
typeAliasRegistry.registerAlias("XML", XMLLanguageDriver.class);
typeAliasRegistry.registerAlias("RAW", RawLanguageDriver.class);
typeAliasRegistry.registerAlias("SLF4J", Slf4jImpl.class);
typeAliasRegistry.registerAlias("COMMONS_LOGGING",
JakartaCommonsLoggingImpl.class);
typeAliasRegistry.registerAlias("LOG4J", Log4jImpl.class);
typeAliasRegistry.registerAlias("LOG4J2", Log4j2Impl.class);
typeAliasRegistry.registerAlias("JDK_LOGGING", Jdk14LoggingImpl.class);
typeAliasRegistry.registerAlias("STDOUT_LOGGING", StdOutImpl.class);
typeAliasRegistry.registerAlias("NO_LOGGING", NoLoggingImpl.class);
typeAliasRegistry.registerAlias("CGLIB", CglibProxyFactory.class);
typeAliasRegistry.registerAlias("JAVASSIST",
JavassistProxyFactory.class);
languageRegistry.setDefaultDriverClass(XMLLanguageDriver.class);
languageRegistry.register(RawLanguageDriver.class);
}
示例5: Configuration
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; //导入依赖的package包/类
public Configuration() {
typeAliasRegistry.registerAlias("JDBC", JdbcTransactionFactory.class);
typeAliasRegistry.registerAlias("MANAGED", ManagedTransactionFactory.class);
typeAliasRegistry.registerAlias("JNDI", JndiDataSourceFactory.class);
typeAliasRegistry.registerAlias("POOLED", PooledDataSourceFactory.class);
typeAliasRegistry.registerAlias("UNPOOLED", UnpooledDataSourceFactory.class);
typeAliasRegistry.registerAlias("PERPETUAL", PerpetualCache.class);
typeAliasRegistry.registerAlias("FIFO", FifoCache.class);
typeAliasRegistry.registerAlias("LRU", LruCache.class);
typeAliasRegistry.registerAlias("SOFT", SoftCache.class);
typeAliasRegistry.registerAlias("WEAK", WeakCache.class);
typeAliasRegistry.registerAlias("DB_VENDOR", VendorDatabaseIdProvider.class);
typeAliasRegistry.registerAlias("XML", XMLLanguageDriver.class);
typeAliasRegistry.registerAlias("RAW", RawLanguageDriver.class);
typeAliasRegistry.registerAlias("SLF4J", Slf4jImpl.class);
typeAliasRegistry.registerAlias("COMMONS_LOGGING", JakartaCommonsLoggingImpl.class);
typeAliasRegistry.registerAlias("LOG4J", Log4jImpl.class);
typeAliasRegistry.registerAlias("LOG4J2", Log4j2Impl.class);
typeAliasRegistry.registerAlias("JDK_LOGGING", Jdk14LoggingImpl.class);
typeAliasRegistry.registerAlias("STDOUT_LOGGING", StdOutImpl.class);
typeAliasRegistry.registerAlias("NO_LOGGING", NoLoggingImpl.class);
typeAliasRegistry.registerAlias("CGLIB", CglibProxyFactory.class);
typeAliasRegistry.registerAlias("JAVASSIST", JavassistProxyFactory.class);
languageRegistry.setDefaultDriverClass(XMLLanguageDriver.class);
languageRegistry.register(RawLanguageDriver.class);
}
示例6: Configuration
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; //导入依赖的package包/类
public Configuration() {
//注册更多的类型别名,至于为何不直接在TypeAliasRegistry里注册,还需进一步研究
typeAliasRegistry.registerAlias("JDBC", JdbcTransactionFactory.class);
typeAliasRegistry.registerAlias("MANAGED", ManagedTransactionFactory.class);
typeAliasRegistry.registerAlias("JNDI", JndiDataSourceFactory.class);
typeAliasRegistry.registerAlias("POOLED", PooledDataSourceFactory.class);
typeAliasRegistry.registerAlias("UNPOOLED", UnpooledDataSourceFactory.class);
typeAliasRegistry.registerAlias("PERPETUAL", PerpetualCache.class);
typeAliasRegistry.registerAlias("FIFO", FifoCache.class);
typeAliasRegistry.registerAlias("LRU", LruCache.class);
typeAliasRegistry.registerAlias("SOFT", SoftCache.class);
typeAliasRegistry.registerAlias("WEAK", WeakCache.class);
typeAliasRegistry.registerAlias("DB_VENDOR", VendorDatabaseIdProvider.class);
typeAliasRegistry.registerAlias("XML", XMLLanguageDriver.class);
typeAliasRegistry.registerAlias("RAW", RawLanguageDriver.class);
typeAliasRegistry.registerAlias("SLF4J", Slf4jImpl.class);
typeAliasRegistry.registerAlias("COMMONS_LOGGING", JakartaCommonsLoggingImpl.class);
typeAliasRegistry.registerAlias("LOG4J", Log4jImpl.class);
typeAliasRegistry.registerAlias("LOG4J2", Log4j2Impl.class);
typeAliasRegistry.registerAlias("JDK_LOGGING", Jdk14LoggingImpl.class);
typeAliasRegistry.registerAlias("STDOUT_LOGGING", StdOutImpl.class);
typeAliasRegistry.registerAlias("NO_LOGGING", NoLoggingImpl.class);
typeAliasRegistry.registerAlias("CGLIB", CglibProxyFactory.class);
typeAliasRegistry.registerAlias("JAVASSIST", JavassistProxyFactory.class);
languageRegistry.setDefaultDriverClass(XMLLanguageDriver.class);
languageRegistry.register(RawLanguageDriver.class);
}
示例7: Configuration
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; //导入依赖的package包/类
public Configuration() {
//事务类型
typeAliasRegistry.registerAlias("JDBC", JdbcTransactionFactory.class);
typeAliasRegistry.registerAlias("MANAGED", ManagedTransactionFactory.class);
//数据源与连接池类型
typeAliasRegistry.registerAlias("JNDI", JndiDataSourceFactory.class);
typeAliasRegistry.registerAlias("POOLED", PooledDataSourceFactory.class);
typeAliasRegistry.registerAlias("UNPOOLED", UnpooledDataSourceFactory.class);
typeAliasRegistry.registerAlias("PERPETUAL", PerpetualCache.class);
typeAliasRegistry.registerAlias("FIFO", FifoCache.class);
typeAliasRegistry.registerAlias("LRU", LruCache.class);
typeAliasRegistry.registerAlias("SOFT", SoftCache.class);
typeAliasRegistry.registerAlias("WEAK", WeakCache.class);
typeAliasRegistry.registerAlias("DB_VENDOR", VendorDatabaseIdProvider.class);
typeAliasRegistry.registerAlias("XML", XMLLanguageDriver.class);
typeAliasRegistry.registerAlias("RAW", RawLanguageDriver.class);
typeAliasRegistry.registerAlias("SLF4J", Slf4jImpl.class);
typeAliasRegistry.registerAlias("COMMONS_LOGGING", JakartaCommonsLoggingImpl.class);
typeAliasRegistry.registerAlias("LOG4J", Log4jImpl.class);
typeAliasRegistry.registerAlias("LOG4J2", Log4j2Impl.class);
typeAliasRegistry.registerAlias("JDK_LOGGING", Jdk14LoggingImpl.class);
typeAliasRegistry.registerAlias("STDOUT_LOGGING", StdOutImpl.class);
typeAliasRegistry.registerAlias("NO_LOGGING", NoLoggingImpl.class);
typeAliasRegistry.registerAlias("CGLIB", CglibProxyFactory.class);
typeAliasRegistry.registerAlias("JAVASSIST", JavassistProxyFactory.class);
languageRegistry.setDefaultDriverClass(XMLLanguageDriver.class);
languageRegistry.register(RawLanguageDriver.class);
}
示例8: shouldSuccessfullyLoadMinimalXMLConfigFile
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; //导入依赖的package包/类
@Test
public void shouldSuccessfullyLoadMinimalXMLConfigFile() throws Exception {
String resource = "org/apache/ibatis/builder/MinimalMapperConfig.xml";
InputStream inputStream = Resources.getResourceAsStream(resource);
XMLConfigBuilder builder = new XMLConfigBuilder(inputStream);
Configuration config = builder.parse();
assertNotNull(config);
assertThat(config.getAutoMappingBehavior(), is(AutoMappingBehavior.PARTIAL));
assertThat(config.isCacheEnabled(), is(true));
assertThat(config.getProxyFactory(), is(instanceOf(JavassistProxyFactory.class)));
assertThat(config.isLazyLoadingEnabled(), is(false));
assertThat(config.isAggressiveLazyLoading(), is(true));
assertThat(config.isMultipleResultSetsEnabled(), is(true));
assertThat(config.isUseColumnLabel(), is(true));
assertThat(config.isUseGeneratedKeys(), is(false));
assertThat(config.getDefaultExecutorType(), is(ExecutorType.SIMPLE));
assertNull(config.getDefaultStatementTimeout());
assertNull(config.getDefaultFetchSize());
assertThat(config.isMapUnderscoreToCamelCase(), is(false));
assertThat(config.isSafeRowBoundsEnabled(), is(false));
assertThat(config.getLocalCacheScope(), is(LocalCacheScope.SESSION));
assertThat(config.getJdbcTypeForNull(), is(JdbcType.OTHER));
assertThat(config.getLazyLoadTriggerMethods(), is((Set<String>) new HashSet<String>(Arrays.asList("equals", "clone", "hashCode", "toString"))));
assertThat(config.isSafeResultHandlerEnabled(), is(true));
assertThat(config.getDefaultScriptingLanuageInstance(), is(instanceOf(XMLLanguageDriver.class)));
assertThat(config.isCallSettersOnNulls(), is(false));
assertNull(config.getLogPrefix());
assertNull(config.getLogImpl());
assertNull(config.getConfigurationFactory());
}
示例9: shouldSuccessfullyLoadMinimalXMLConfigFile
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; //导入依赖的package包/类
@Test
public void shouldSuccessfullyLoadMinimalXMLConfigFile() throws Exception {
String resource = "org/apache/ibatis/builder/MinimalMapperConfig.xml";
InputStream inputStream = Resources.getResourceAsStream(resource);
XMLConfigBuilder builder = new XMLConfigBuilder(inputStream);
Configuration config = builder.parse();
assertNotNull(config);
assertThat(config.getAutoMappingBehavior()).isEqualTo(AutoMappingBehavior.PARTIAL);
assertThat(config.getAutoMappingUnknownColumnBehavior()).isEqualTo(AutoMappingUnknownColumnBehavior.NONE);
assertThat(config.isCacheEnabled()).isTrue();
assertThat(config.getProxyFactory()).isInstanceOf(JavassistProxyFactory.class);
assertThat(config.isLazyLoadingEnabled()).isFalse();
assertThat(config.isAggressiveLazyLoading()).isFalse();
assertThat(config.isMultipleResultSetsEnabled()).isTrue();
assertThat(config.isUseColumnLabel()).isTrue();
assertThat(config.isUseGeneratedKeys()).isFalse();
assertThat(config.getDefaultExecutorType()).isEqualTo(ExecutorType.SIMPLE);
assertNull(config.getDefaultStatementTimeout());
assertNull(config.getDefaultFetchSize());
assertThat(config.isMapUnderscoreToCamelCase()).isFalse();
assertThat(config.isSafeRowBoundsEnabled()).isFalse();
assertThat(config.getLocalCacheScope()).isEqualTo(LocalCacheScope.SESSION);
assertThat(config.getJdbcTypeForNull()).isEqualTo(JdbcType.OTHER);
assertThat(config.getLazyLoadTriggerMethods()).isEqualTo((Set<String>) new HashSet<String>(Arrays.asList("equals", "clone", "hashCode", "toString")));
assertThat(config.isSafeResultHandlerEnabled()).isTrue();
assertThat(config.getDefaultScriptingLanuageInstance()).isInstanceOf(XMLLanguageDriver.class);
assertThat(config.isCallSettersOnNulls()).isFalse();
assertNull(config.getLogPrefix());
assertNull(config.getLogImpl());
assertNull(config.getConfigurationFactory());
assertThat(config.getTypeHandlerRegistry().getTypeHandler(RoundingMode.class)).isInstanceOf(EnumTypeHandler.class);
inputStream.close();
}
示例10: setDefaultScriptingLanguage
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; //导入依赖的package包/类
public void setDefaultScriptingLanguage(Class<?> driver) {
if (driver == null) {
driver = XMLLanguageDriver.class;
}
getLanguageRegistry().setDefaultDriverClass(driver);
}
示例11: selectXmlWithMapper
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; //导入依赖的package包/类
@Lang(XMLLanguageDriver.class)
@Select("<script>SELECT firstName <if test=\"includeLastName != null\">, lastName</if> FROM names WHERE lastName LIKE #{name}</script>")
List<Name> selectXmlWithMapper(Parameter p);
示例12: selectXmlWithMapperAndSqlSymbols
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; //导入依赖的package包/类
@Lang(XMLLanguageDriver.class)
@Select("SELECT firstName, lastName FROM names WHERE lastName LIKE #{name} and 0 < 1")
List<Name> selectXmlWithMapperAndSqlSymbols(Parameter p);
示例13: setDefaultScriptingLanguage
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; //导入依赖的package包/类
public void setDefaultScriptingLanguage(Class<?> driver) {
if (driver == null) {
driver = XMLLanguageDriver.class;
}
getLanguageRegistry().setDefaultDriverClass(driver);
}