Examples of JdbcTransactionFactory


Examples of org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory

        Properties dataSourceProperties = new Properties();
        dataSourceProperties.put("driver", "org.hsqldb.jdbcDriver");
        dataSourceProperties.put("url", "jdbc:hsqldb:mem:xml_references");
        dataSourceProperties.put("username", "sa");
        dataSourceFactory.setProperties(dataSourceProperties);
        Environment environment = new Environment("test", new JdbcTransactionFactory(), dataSourceFactory.getDataSource());
        Configuration configuration = new Configuration();
        configuration.setEnvironment(environment);
        configuration.getTypeAliasRegistry().registerAlias(Person.class);
        configuration.addMapper(PersonMapper.class);
        configuration.addMapper(PersonMapper2.class);
View Full Code Here

Examples of org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory

public class ParentChildCircularTest extends BaseDataTest {

  @Test
  public void shouldDemonstrateCircularRelationShipsNotSupportedWithJoinMapping() throws Exception {
    DataSource ds = BaseDataTest.createBlogDataSource();
    Environment env = new Environment("test",new JdbcTransactionFactory(),ds);
    Configuration config = new Configuration(env);
    config.addMapper(NodeMapper.class);
    SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder();
    SqlSessionFactory sqlMapper = builder.build(config);
    SqlSession session = sqlMapper.openSession();
View Full Code Here

Examples of org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory

  }

  @Test
  public void shouldSucceedAddingRowWithNullValueWithHSQLDB() throws Exception {
    DataSource ds = BaseDataTest.createJPetstoreDataSource();
    Environment env = new Environment("test",new JdbcTransactionFactory(),ds);
    Configuration config = new Configuration(env);
    config.addMapper(JPetStoreMapper.class);

    SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder();
    SqlSessionFactory sqlMapper = builder.build(config);
View Full Code Here

Examples of org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory

  }

  @Test
  public void shouldParseMapWithIntegerJdbcType() throws Exception {
    DataSource ds = BaseDataTest.createBlogDataSource();
    Environment env = new Environment("test",new JdbcTransactionFactory(),ds);
    Configuration config = new Configuration(env);
    config.addMapper(BlogMapper.class);

    SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder();
    SqlSessionFactory sqlMapper = builder.build(config);
View Full Code Here

Examples of org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory

    Class.forName("org.hsqldb.jdbcDriver");
    Connection c = DriverManager.getConnection("jdbc:hsqldb:mem:xmlextref", "sa", "");
    initDb(c);

    Configuration configuration = new Configuration();
    Environment environment = new Environment("development", new JdbcTransactionFactory(), new UnpooledDataSource(
        "org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:xmlextref", null));
    configuration.setEnvironment(environment);

    configuration.addMapper(MultipleReverseIncludePersonMapper.class);
View Full Code Here

Examples of org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory

  public SqlSessionFactory getSqlSessionFactory() {
    try {
      DataSource dataSource = BaseDataTest.createBlogDataSource();
      BaseDataTest.runScript(dataSource, BaseDataTest.BLOG_DDL);
      BaseDataTest.runScript(dataSource, BaseDataTest.BLOG_DATA);
      TransactionFactory transactionFactory = new JdbcTransactionFactory();
      Environment environment = new Environment("Production", transactionFactory, dataSource);
      Configuration configuration = new Configuration(environment);
      configuration.setLazyLoadingEnabled(true);
      configuration.getTypeAliasRegistry().registerAlias(Blog.class);
      configuration.getTypeAliasRegistry().registerAlias(Post.class);
View Full Code Here

Examples of org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory

    Class.forName("org.hsqldb.jdbcDriver");
    Connection c = DriverManager.getConnection("jdbc:hsqldb:mem:xmlextref", "sa", "");
    initDb(c);

    Configuration configuration = new Configuration();
    Environment environment = new Environment("development", new JdbcTransactionFactory(), new UnpooledDataSource(
        "org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:xmlextref", null));
    configuration.setEnvironment(environment);

    configuration.addMapper(ReverseIncludePersonMapper.class);
View Full Code Here

Examples of org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory

    Class.forName("org.hsqldb.jdbcDriver");
    Connection c = DriverManager.getConnection("jdbc:hsqldb:mem:xmlextref", "sa", "");
    initDb(c);

    Configuration configuration = new Configuration();
    Environment environment = new Environment("development", new JdbcTransactionFactory(), new UnpooledDataSource(
        "org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:xmlextref", null));
    configuration.setEnvironment(environment);

    configuration.addMapper(ResultMapReferencePersonMapper.class);
    configuration.addMapper(ResultMapReferencePetMapper.class);
View Full Code Here

Examples of org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory

    Class.forName("org.hsqldb.jdbcDriver");
    Connection c = DriverManager.getConnection("jdbc:hsqldb:mem:xmlextref", "sa", "");
    initDb(c);

    Configuration configuration = new Configuration();
    Environment environment = new Environment("development", new JdbcTransactionFactory(), new UnpooledDataSource(
        "org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:xmlextref", null));
    configuration.setEnvironment(environment);

    configuration.addMapper(PersonMapper.class);
    configuration.addMapper(PetMapper.class);
View Full Code Here

Examples of org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory

    Class.forName("org.hsqldb.jdbcDriver");
    Connection c = DriverManager.getConnection("jdbc:hsqldb:mem:xmlextref", "sa", "");
    initDb(c);

    Configuration configuration = new Configuration();
    Environment environment = new Environment("development", new JdbcTransactionFactory(), new UnpooledDataSource(
        "org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:xmlextref", null));
    configuration.setEnvironment(environment);

    configuration.addMapper(ResultMapReferencePersonMapper.class);
    configuration.addMapper(ResultMapReferencePetMapper.class);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.