Package org.apache.ibatis.mapping

Examples of org.apache.ibatis.mapping.Environment


        DataSource dataSourceToUse = this.dataSource;
        if (this.useTransactionAwareDataSource  && !(this.dataSource instanceof TransactionAwareDataSourceProxy)) { 
                dataSourceToUse = new TransactionAwareDataSourceProxy(this.dataSource)
            }
       
        conf.setEnvironment(new Environment("development",new ManagedTransactionFactory(),dataSourceToUse));
        sqlSessionFactory = new SqlSessionFactoryBuilder().build(conf);
      }
     
      if(mapperLocations != null) {
        Map<String, XNode> sqlFragments = new HashMap<String, XNode>();
View Full Code Here


      InputStream inputStream = null;
      try {
        inputStream = getMyBatisXmlConfigurationSteam();

        // update the jdbc parameters to the configured ones...
        Environment environment = new Environment("default", transactionFactory, dataSource);
        Reader reader = new InputStreamReader(inputStream);
        Properties properties = new Properties();
        properties.put("prefix", databaseTablePrefix);
        if(databaseType != null) {
          properties.put("limitBefore" , DbSqlSessionFactory.databaseSpecificLimitBeforeStatements.get(databaseType));
View Full Code Here

                InputStream inputStream = null;
                try {
                    inputStream = ReflectUtil.getResourceAsStream("org/aperteworkflow/ext/activiti/mybatis/mappings-enhanced.xml");

                    // update the jdbc parameters to the configured ones...
                    Environment environment = new Environment("default", transactionFactory, dataSource);
                    Reader reader = new InputStreamReader(inputStream);
                    XMLConfigBuilder parser = new XMLConfigBuilder(reader);
                    Configuration configuration = parser.getConfiguration();
                    configuration.setEnvironment(environment);
                    configuration.getTypeHandlerRegistry().register(VariableType.class, JdbcType.VARCHAR,
View Full Code Here

  public MyBatis start() {
    LogFactory.useSlf4jLogging();

    Configuration conf = new Configuration();
    conf.setEnvironment(new Environment("production", createTransactionFactory(), database.getDataSource()));
    conf.setUseGeneratedKeys(true);
    conf.setLazyLoadingEnabled(false);
    conf.setJdbcTypeForNull(JdbcType.NULL);
    Dialect dialect = database.getDialect();
    conf.setDatabaseId(dialect.getId());
View Full Code Here

      InputStream inputStream = null;
      try {
        inputStream = getMyBatisXmlConfigurationSteam();

        // update the jdbc parameters to the configured ones...
        Environment environment = new Environment("default", transactionFactory, dataSource);
        Reader reader = new InputStreamReader(inputStream);
        Properties properties = new Properties();
        properties.put("prefix", databaseTablePrefix);
        if(databaseType != null) {
          properties.put("limitBefore" , DbSqlSessionFactory.databaseSpecificLimitBeforeStatements.get(databaseType));
View Full Code Here

      InputStream inputStream = null;
      try {
        inputStream = getMyBatisXmlConfigurationSteam();

        // update the jdbc parameters to the configured ones...
        Environment environment = new Environment("default", transactionFactory, dataSource);
        Reader reader = new InputStreamReader(inputStream);
        Properties properties = new Properties();
        properties.put("prefix", databaseTablePrefix);
        if(databaseType != null) {
          properties.put("limitBefore" , DbSqlSessionFactory.databaseSpecificLimitBeforeStatements.get(databaseType));
View Full Code Here

        @Override
        public void init()
        {
            TransactionFactory transactionFactory = new JdbcTransactionFactory();
            Environment environment = new Environment("development", transactionFactory, sql2o.getDataSource());
            org.apache.ibatis.session.Configuration config = new org.apache.ibatis.session.Configuration(environment);
            config.addMapper(MyBatisPostMapper.class);
            SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(config);
            session = sqlSessionFactory.openSession();
        }
View Full Code Here

TOP

Related Classes of org.apache.ibatis.mapping.Environment

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.