Package org.apache.ibatis.type

Examples of org.apache.ibatis.type.TypeAliasRegistry


  @Test
  public void testAddATypeAlias() throws Exception {
    setupFactoryBean();

    factoryBean.setTypeAliases(new Class[] { DummyTypeAlias.class });
    TypeAliasRegistry typeAliasRegistry = factoryBean.getObject().getConfiguration().getTypeAliasRegistry();
    typeAliasRegistry.resolveAlias("testAlias");
  }
View Full Code Here


  @Test
  public void testSearchATypeAliasPackage() throws Exception {
    setupFactoryBean();
    factoryBean.setTypeAliasesPackage("org/mybatis/spring/type");

    TypeAliasRegistry typeAliasRegistry = factoryBean.getObject().getConfiguration().getTypeAliasRegistry();
    typeAliasRegistry.resolveAlias("testAlias");
    typeAliasRegistry.resolveAlias("testAlias2");
    typeAliasRegistry.resolveAlias("dummyTypeHandler");
    typeAliasRegistry.resolveAlias("superType");
  }
View Full Code Here

  public void testSearchATypeAliasPackageWithSuperType() throws Exception {
    setupFactoryBean();
    factoryBean.setTypeAliasesSuperType(SuperType.class);
    factoryBean.setTypeAliasesPackage("org/mybatis/spring/type");

    TypeAliasRegistry typeAliasRegistry = factoryBean.getObject().getConfiguration().getTypeAliasRegistry();
    typeAliasRegistry.resolveAlias("testAlias2");
    typeAliasRegistry.resolveAlias("superType");

    try {
        typeAliasRegistry.resolveAlias("testAlias");
        fail();
    } catch (TypeException e) {
        // expected
    }

    try {
        typeAliasRegistry.resolveAlias("dummyTypeHandler");
        fail();
    } catch (TypeException e) {
        // expected
    }
  }
View Full Code Here

    reader.close();
  }

  @Test
  public void testTypeAlias() {
    TypeAliasRegistry typeAliasRegistry = sqlSessionFactory.getConfiguration().getTypeAliasRegistry();
    typeAliasRegistry.resolveAlias("testAlias");
  }
View Full Code Here

TOP

Related Classes of org.apache.ibatis.type.TypeAliasRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.