ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbe...@apache.org
Subject svn commit: r746434 - in /ibatis/trunk/java/ibatis-3: ./ ibatis-3-core/src/main/java/org/apache/ibatis/api/defaults/ ibatis-3-core/src/main/java/org/apache/ibatis/mapping/ ibatis-3-core/src/test/java/domain/blog/mappers/ ibatis-3-core/src/test/java/org...
Date Sat, 21 Feb 2009 04:39:00 GMT
Author: cbegin
Date: Sat Feb 21 04:38:59 2009
New Revision: 746434

URL: http://svn.apache.org/viewvc?rev=746434&view=rev
Log:
Moved MapperFactory to config

Added:
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/domain/blog/mappers/AnnoMapper.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/BindingTest.java
Modified:
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/api/defaults/DefaultSqlSession.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/mapping/Configuration.java
    ibatis/trunk/java/ibatis-3/version.properties

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/api/defaults/DefaultSqlSession.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/api/defaults/DefaultSqlSession.java?rev=746434&r1=746433&r2=746434&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/api/defaults/DefaultSqlSession.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/api/defaults/DefaultSqlSession.java
Sat Feb 21 04:38:59 2009
@@ -13,8 +13,6 @@
 
 public class DefaultSqlSession implements SqlSession {
 
-  private MapperFactory mapperFactory;
-
   private Configuration configuration;
   private Executor executor;
 
@@ -22,7 +20,6 @@
   private boolean dirty;
 
   public DefaultSqlSession(Configuration configuration, Executor executor, boolean autoCommit)
{
-    this.mapperFactory = new MapperFactory();
     this.configuration = configuration;
     this.executor = executor;
     this.autoCommit = autoCommit;
@@ -146,7 +143,7 @@
   }
 
   public <T> T getMapper(Class<T> type) {
-    return mapperFactory.getMapper(type, this);
+    return configuration.getMapperFactory().getMapper(type, this);
   }
 
   private boolean isCommitOrRollbackRequired(boolean force) {

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/mapping/Configuration.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/mapping/Configuration.java?rev=746434&r1=746433&r2=746434&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/mapping/Configuration.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/mapping/Configuration.java
Sat Feb 21 04:38:59 2009
@@ -26,6 +26,7 @@
 import org.apache.ibatis.transaction.managed.ManagedTransactionFactory;
 import org.apache.ibatis.type.TypeAliasRegistry;
 import org.apache.ibatis.type.TypeHandlerRegistry;
+import org.apache.ibatis.binding.MapperFactory;
 
 import java.util.Collection;
 import java.util.HashMap;
@@ -47,6 +48,7 @@
 
   private Properties variables = new Properties();
   private ObjectFactory objectFactory = new DefaultObjectFactory();
+  private MapperFactory mapperFactory = new MapperFactory();
 
   private final InterceptorChain interceptorChain = new InterceptorChain();
   private final TypeHandlerRegistry typeHandlerRegistry = new TypeHandlerRegistry();
@@ -274,6 +276,10 @@
     interceptorChain.addInterceptor(interceptor);
   }
 
+  public MapperFactory getMapperFactory() {
+    return mapperFactory;
+  }
+
   private static class StrictMap<J, K> extends HashMap<J, K> {
 
     private String name;

Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/domain/blog/mappers/AnnoMapper.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/domain/blog/mappers/AnnoMapper.java?rev=746434&view=auto
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/domain/blog/mappers/AnnoMapper.java
(added)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/domain/blog/mappers/AnnoMapper.java
Sat Feb 21 04:38:59 2009
@@ -0,0 +1,4 @@
+package domain.blog.mappers;
+
+public class AnnoMapper {
+}

Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/BindingTest.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/BindingTest.java?rev=746434&view=auto
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/BindingTest.java
(added)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/BindingTest.java
Sat Feb 21 04:38:59 2009
@@ -0,0 +1,29 @@
+package org.apache.ibatis.binding;
+
+import org.apache.ibatis.BaseDataTest;
+import org.apache.ibatis.io.Resources;
+import org.apache.ibatis.api.SqlSessionFactory;
+import org.apache.ibatis.api.SqlSessionFactoryBuilder;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.Reader;
+
+public class BindingTest  extends BaseDataTest {
+  private static SqlSessionFactory sqlMapper;
+
+  @BeforeClass
+  public static void setup() throws Exception {
+    createBlogDataSource();
+    final String resource = "org/apache/ibatis/parser/MapperConfig.xml";
+    final Reader reader = Resources.getResourceAsReader(resource);
+    sqlMapper = new SqlSessionFactoryBuilder().build(reader);
+  }
+
+  @Test
+  public void foo() {
+    
+  }
+
+
+}

Modified: ibatis/trunk/java/ibatis-3/version.properties
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/version.properties?rev=746434&r1=746433&r2=746434&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/version.properties (original)
+++ ibatis/trunk/java/ibatis-3/version.properties Sat Feb 21 04:38:59 2009
@@ -1,5 +1,5 @@
 #Build version info
-#Sun Feb 15 14:12:50 MST 2009
+#Fri Feb 20 21:23:36 MST 2009
 version=3.0.0
-buildDate=2009/02/15 14\:12
-buildNum=123
+buildDate=2009/02/20 21\:23
+buildNum=125



Mime
View raw message