ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbe...@apache.org
Subject svn commit: r746636 - in /ibatis/trunk/java/ibatis-3: ./ ibatis-3-core/src/main/java/org/apache/ibatis/annotations/ ibatis-3-core/src/main/java/org/apache/ibatis/api/ ibatis-3-core/src/main/java/org/apache/ibatis/binding/ ibatis-3-core/src/main/java/or...
Date Sun, 22 Feb 2009 04:52:13 GMT
Author: cbegin
Date: Sun Feb 22 04:52:12 2009
New Revision: 746636

URL: http://svn.apache.org/viewvc?rev=746636&view=rev
Log:
added binding test, refactored session package

Added:
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/
      - copied from r746572, ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/api/
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SessionException.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/session/
      - copied from r746572, ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/api/
Removed:
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/api/
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/ApiException.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/api/
Modified:
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/annotations/Annotations.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperMethod.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperProxy.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperRegistry.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/mapping/Configuration.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSession.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSessionFactory.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSessionFactoryBuilder.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSession.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSessionFactory.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/BindingTest.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/BoundBlogMapper.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/IbatisConfig.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/session/SqlSessionTest.java
    ibatis/trunk/java/ibatis-3/version.properties

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/annotations/Annotations.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/annotations/Annotations.java?rev=746636&r1=746635&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/annotations/Annotations.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/annotations/Annotations.java
Sun Feb 22 04:52:12 2009
@@ -3,6 +3,8 @@
 import org.apache.ibatis.cache.decorators.LruCache;
 import org.apache.ibatis.cache.impl.PerpetualCache;
 import org.apache.ibatis.type.JdbcType;
+import org.apache.ibatis.mapping.ResultSetType;
+import org.apache.ibatis.mapping.StatementType;
 
 import java.lang.annotation.*;
 
@@ -47,18 +49,18 @@
 
   @Retention(RetentionPolicy.RUNTIME)
   @Target(ElementType.TYPE)
-  public static @interface Cache {
-    Class<? extends org.apache.ibatis.cache.Cache> type() default PerpetualCache.class;
+  public static @interface CacheDomain {
+    Class<? extends org.apache.ibatis.cache.Cache> implementation() default PerpetualCache.class;
     Class<? extends org.apache.ibatis.cache.Cache> eviction() default LruCache.class;
-    int flushInterval() default 3600000;
+    long flushInterval() default 3600000;
     int size() default 1000;
-    boolean readOnly() default false;
+    boolean readWrite() default true;
   }
 
   @Retention(RetentionPolicy.RUNTIME)
   @Target(ElementType.TYPE)
-  public @interface CacheRefNamespace {
-    String[] value();
+  public @interface CacheDomainRef {
+    Class value();
   }
 
   @Retention(RetentionPolicy.RUNTIME)
@@ -97,4 +99,15 @@
     String[] value();
   }
 
+  @Retention(RetentionPolicy.RUNTIME)
+  @Target(ElementType.METHOD)
+  public @interface Options {
+    boolean useCache() default true;
+    boolean flushCache() default false;
+    ResultSetType resultSetType() default ResultSetType.FORWARD_ONLY;
+    StatementType statementType() default StatementType.PREPARED;
+    int fetchSize() default -1;
+    int timeout() default -1;
+  }
+
 }

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperMethod.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperMethod.java?rev=746636&r1=746635&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperMethod.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperMethod.java
Sun Feb 22 04:52:12 2009
@@ -1,6 +1,6 @@
 package org.apache.ibatis.binding;
 
-import org.apache.ibatis.api.SqlSession;
+import org.apache.ibatis.session.SqlSession;
 import org.apache.ibatis.mapping.Configuration;
 import org.apache.ibatis.executor.Executor;
 

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperProxy.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperProxy.java?rev=746636&r1=746635&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperProxy.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperProxy.java
Sun Feb 22 04:52:12 2009
@@ -4,7 +4,7 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 
-import org.apache.ibatis.api.SqlSession;
+import org.apache.ibatis.session.SqlSession;
 
 public class MapperProxy implements InvocationHandler {
 

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperRegistry.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperRegistry.java?rev=746636&r1=746635&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperRegistry.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/binding/MapperRegistry.java
Sun Feb 22 04:52:12 2009
@@ -1,11 +1,19 @@
 package org.apache.ibatis.binding;
 
-import org.apache.ibatis.api.SqlSession;
-import static org.apache.ibatis.annotations.Annotations.*;
+import org.apache.ibatis.session.SqlSession;
 import org.apache.ibatis.mapping.*;
+import static org.apache.ibatis.annotations.Annotations.*;
+import org.apache.ibatis.reflection.MetaObject;
+import org.apache.ibatis.cache.Cache;
+import org.apache.ibatis.parser.InlineSqlSource;
+import org.apache.ibatis.parser.SqlSourceParser;
+import org.apache.ibatis.xml.GenericTokenParser;
 
 import java.util.*;
 import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.TypeVariable;
+import java.lang.annotation.Annotation;
 
 public class MapperRegistry {
 
@@ -17,7 +25,8 @@
   }
 
   public <T> T getMapper(Class<T> type, SqlSession sqlSession) {
-    if (!knownMappers.contains(type)) throw new BindingException("Type " + type + " is not
known to the MapperRegistry.");
+    if (!knownMappers.contains(type))
+      throw new BindingException("Type " + type + " is not known to the MapperRegistry.");
     try {
       return MapperProxy.newMapperProxy(type, sqlSession);
     } catch (Exception e) {
@@ -26,13 +35,108 @@
   }
 
   public void addMapper(Class type) {
-    if (!type.isInterface()) throw new BindingException("Only interfaces can be configured
by the MapperFactory.  Type " + type + " is not an interface.");
-    if (knownMappers.contains(type)) throw new BindingException("Type " + type + " is already
known to the MapperRegistry.");
+    if (!type.isInterface())
+      throw new BindingException("Only interfaces can be configured by the MapperFactory.
 Type " + type + " is not an interface.");
+    if (knownMappers.contains(type))
+      throw new BindingException("Type " + type + " is already known to the MapperRegistry.");
     knownMappers.add(type);
     parseAnnotations(type);
   }
 
   public void parseAnnotations(Class type) {
+    Cache cache = parseCache(type);
+    parseMethodAnnotations(cache,type);
+  }
+
+  private Cache parseCache(Class type) {
+    CacheDomain cacheDomain = (CacheDomain) type.getAnnotation(CacheDomain.class);
+    if (cacheDomain != null) {
+      CacheBuilder builder = new CacheBuilder(type.getName() + "-Cache");
+      builder.clearInterval(cacheDomain.flushInterval());
+      builder.size(cacheDomain.size());
+      builder.readWrite(cacheDomain.readWrite());
+      builder.implementation(cacheDomain.implementation());
+      builder.addDecorator(cacheDomain.eviction());
+      return builder.build();
+    }
+    return null;
+  }
+
+  private void parseMethodAnnotations(Cache cache, Class type) {
+    Method[] methods = type.getMethods();
+    for (Method method : methods) {
+      MappedStatement statement = parseMappedStatement(method, cache);
+      if (statement != null) {
+      config.addMappedStatement(statement);
+      }
+    }
+  }
+
+  private MappedStatement parseMappedStatement(Method method, Cache cache) {
+    Class annotationType = getSqlAnnotationType(method);
+    if (annotationType != null) {
+    String sql = getSqlAnnotationValue(method, annotationType);
+    String mappedStatementId = method.getDeclaringClass().getName() + "." + method.getName();
+    SqlSource sqlSource = new BasicSqlSource(sql);
+    MappedStatement.Builder builder = new MappedStatement.Builder(config, mappedStatementId,
sqlSource);
+    builder.resource(method.getDeclaringClass().getName().replace('.', '/') + ".java (best
guess)");
+
+    Options options = method.getAnnotation(Options.class);
+    if (options != null) {
+      builder.useCache(options.useCache());
+      builder.flushCacheRequired(options.flushCache());
+      builder.resultSetType(options.resultSetType());
+      builder.statementType(options.statementType());
+      builder.fetchSize(options.fetchSize());
+      builder.timeout(options.timeout());
+    }
+
+    builder.cache(cache);
+
+    Class returnType = method.getReturnType();
+    if (returnType.isAssignableFrom(Collection.class)) {
+      TypeVariable<? extends Class<?>>[] returnTypeVariables = returnType.getTypeParameters();
+      if (returnTypeVariables.length == 1) {
+        returnType = returnTypeVariables[0].getGenericDeclaration();
+      }
+    }
+
+    builder.parameterMap(new ParameterMap.Builder(config,"",Object.class,new ArrayList<ParameterMapping>()).build());
+    final ResultMap resultMap = new ResultMap.Builder(config, "", returnType, new ArrayList<ResultMapping>()).build();
+    builder.resultMaps(new ArrayList<ResultMap>() {{ add(resultMap); }});
+
+    return builder.build();
+    }
+    return null;
+  }
+
+  private String getSqlAnnotationValue(Method method, Class annotationType) {
+    Annotation annotation = method.getAnnotation(annotationType);
+    if (annotation != null) {
+      try {
+        String[] strings = (String[]) annotation.getClass().getMethod("value").invoke(annotation);
+        StringBuilder sql = new StringBuilder();
+        for(String fragment : strings) {
+          sql.append(fragment);
+          sql.append(" ");
+        }
+        return sql.toString();
+      } catch (Exception e) {
+        throw new RuntimeException("Could not find value method on SQL annotation.  Cause:
" + e, e);
+      }
+    }
+    throw new BindingException("Reuested value from annotation that does not exist: " + annotationType);
+  }
+
+  private Class getSqlAnnotationType(Method method) {
+    Class[] types = {Select.class, Insert.class, Update.class, Delete.class, Procedure.class,
Statement.class};
+    for (Class type : types) {
+      Annotation annotation = method.getAnnotation(type);
+      if (annotation != null) {
+        return type;
+      }
+    }
+    return null;
   }
 
 }

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=746636&r1=746635&r2=746636&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
Sun Feb 22 04:52:12 2009
@@ -27,7 +27,7 @@
 import org.apache.ibatis.type.TypeAliasRegistry;
 import org.apache.ibatis.type.TypeHandlerRegistry;
 import org.apache.ibatis.binding.MapperRegistry;
-import org.apache.ibatis.api.SqlSession;
+import org.apache.ibatis.session.SqlSession;
 
 import java.util.Collection;
 import java.util.HashMap;

Added: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SessionException.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SessionException.java?rev=746636&view=auto
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SessionException.java
(added)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SessionException.java
Sun Feb 22 04:52:12 2009
@@ -0,0 +1,20 @@
+package org.apache.ibatis.session;
+
+public class SessionException extends RuntimeException {
+
+  public SessionException() {
+    super();
+  }
+
+  public SessionException(String message) {
+    super(message);
+  }
+
+  public SessionException(String message, Throwable cause) {
+    super(message, cause);
+  }
+
+  public SessionException(Throwable cause) {
+    super(cause);
+  }
+}

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSession.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSession.java?rev=746636&r1=746572&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSession.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSession.java
Sun Feb 22 04:52:12 2009
@@ -1,4 +1,4 @@
-package org.apache.ibatis.api;
+package org.apache.ibatis.session;
 
 import org.apache.ibatis.executor.result.ResultHandler;
 import org.apache.ibatis.mapping.Configuration;

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSessionFactory.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSessionFactory.java?rev=746636&r1=746572&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSessionFactory.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSessionFactory.java
Sun Feb 22 04:52:12 2009
@@ -1,4 +1,4 @@
-package org.apache.ibatis.api;
+package org.apache.ibatis.session;
 
 import org.apache.ibatis.mapping.Configuration;
 import org.apache.ibatis.mapping.ExecutorType;

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSessionFactoryBuilder.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSessionFactoryBuilder.java?rev=746636&r1=746572&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSessionFactoryBuilder.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/SqlSessionFactoryBuilder.java
Sun Feb 22 04:52:12 2009
@@ -1,6 +1,6 @@
-package org.apache.ibatis.api;
+package org.apache.ibatis.session;
 
-import org.apache.ibatis.api.defaults.DefaultSqlSessionFactory;
+import org.apache.ibatis.session.defaults.DefaultSqlSessionFactory;
 import org.apache.ibatis.exceptions.ExceptionFactory;
 import org.apache.ibatis.mapping.Configuration;
 import org.apache.ibatis.parser.MapperConfigParser;

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSession.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSession.java?rev=746636&r1=746572&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSession.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSession.java
Sun Feb 22 04:52:12 2009
@@ -1,7 +1,7 @@
-package org.apache.ibatis.api.defaults;
+package org.apache.ibatis.session.defaults;
 
-import org.apache.ibatis.api.ApiException;
-import org.apache.ibatis.api.SqlSession;
+import org.apache.ibatis.session.SessionException;
+import org.apache.ibatis.session.SqlSession;
 import org.apache.ibatis.exceptions.ExceptionFactory;
 import org.apache.ibatis.executor.Executor;
 import org.apache.ibatis.executor.result.ResultHandler;
@@ -32,7 +32,7 @@
   public Object selectOne(String statement, Object parameter) {
     List list = selectList(statement, parameter);
     if (list.size() != 1) {
-      throw new ApiException("Expected one result to be returned by selectOne(), but found:
" + list.size());
+      throw new SessionException("Expected one result to be returned by selectOne(), but
found: " + list.size());
     }
     return list.get(0);
   }

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSessionFactory.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSessionFactory.java?rev=746636&r1=746572&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSessionFactory.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/session/defaults/DefaultSqlSessionFactory.java
Sun Feb 22 04:52:12 2009
@@ -1,7 +1,7 @@
-package org.apache.ibatis.api.defaults;
+package org.apache.ibatis.session.defaults;
 
-import org.apache.ibatis.api.SqlSession;
-import org.apache.ibatis.api.SqlSessionFactory;
+import org.apache.ibatis.session.SqlSession;
+import org.apache.ibatis.session.SqlSessionFactory;
 import org.apache.ibatis.exceptions.ExceptionFactory;
 import org.apache.ibatis.executor.Executor;
 import org.apache.ibatis.logging.Log;

Modified: 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=746636&r1=746635&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/BindingTest.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/BindingTest.java
Sun Feb 22 04:52:12 2009
@@ -1,8 +1,12 @@
 package org.apache.ibatis.binding;
 
-import org.apache.ibatis.api.SqlSessionFactory;
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.apache.ibatis.session.SqlSession;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import domain.blog.Blog;
+
+import java.util.List;
 
 public class BindingTest {
   private static SqlSessionFactory sqlSessionFactory;
@@ -13,8 +17,16 @@
   }
 
   @Test
-  public void foo() {
-  
+  public void shouldExecuteBoundSelectStatement() {
+    SqlSession session = sqlSessionFactory.openSession();
+    try {
+      BoundBlogMapper mapper = session.getMapper(BoundBlogMapper.class);
+      List<Blog> blogs = mapper.selectBlogs();
+      System.out.println(blogs.size());
+    } finally {
+      session.close();
+    }
+
   }
 
 

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/BoundBlogMapper.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/BoundBlogMapper.java?rev=746636&r1=746635&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/BoundBlogMapper.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/BoundBlogMapper.java
Sun Feb 22 04:52:12 2009
@@ -3,27 +3,28 @@
 import domain.blog.Blog;
 import static org.apache.ibatis.annotations.Annotations.*;
 
-@Cache
+import java.util.List;
+
+@CacheDomain
 public interface BoundBlogMapper {
 
-  @ConstructorArgs({
-      @Arg(id = true, column = ""),
-      @Arg(column = ""),
-      @Arg(column = "")
-      })
-  @Results({
-      @Result(column = "A",property = ""),
-      @Result(column = "B",property = "", collectionSelect = "com.domain.Class.method"),
-      @Result(column = "C",property = "", collectionResults = @Results({
-        @Result(column = "X",property = ""),
-        @Result(column = "Y",property = "")
-      }))
-  })
+//  @ConstructorArgs({
+//      @Arg(id = true, column = ""),
+//      @Arg(column = ""),
+//      @Arg(column = "")
+//      })
+//  @Results({
+//      @Result(column = "A",property = ""),
+//      @Result(column = "B",property = "", collectionSelect = "com.domain.Class.method"),
+//      @Result(column = "C",property = "", collectionResults = @Results({
+//        @Result(column = "X",property = ""),
+//        @Result(column = "Y",property = "")
+//      }))
+//  })
   @Select({
       "SELECT *",
-      "FROM BLOG",
-      "where id = ${id}"
+      "FROM blog"
       })
-  Blog selectBlog(int id);
+  List<Blog> selectBlogs();
 
 }

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/IbatisConfig.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/IbatisConfig.java?rev=746636&r1=746635&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/IbatisConfig.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/binding/IbatisConfig.java
Sun Feb 22 04:52:12 2009
@@ -1,7 +1,7 @@
 package org.apache.ibatis.binding;
 
-import org.apache.ibatis.api.SqlSessionFactory;
-import org.apache.ibatis.api.defaults.DefaultSqlSessionFactory;
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.apache.ibatis.session.defaults.DefaultSqlSessionFactory;
 import org.apache.ibatis.mapping.*;
 import org.apache.ibatis.transaction.TransactionFactory;
 import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory;

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/session/SqlSessionTest.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/session/SqlSessionTest.java?rev=746636&r1=746572&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/session/SqlSessionTest.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/test/java/org/apache/ibatis/session/SqlSessionTest.java
Sun Feb 22 04:52:12 2009
@@ -1,4 +1,4 @@
-package org.apache.ibatis.api;
+package org.apache.ibatis.session;
 
 import domain.blog.*;
 import org.apache.ibatis.BaseDataTest;
@@ -349,7 +349,7 @@
         mapper.selectAuthor(101);
         fail("Expected exception.");
       } catch(Exception e) {
-        assertEquals(ApiException.class, e.getClass());
+        assertEquals(SessionException.class, e.getClass());
       }
     } finally {
       session.close();

Modified: ibatis/trunk/java/ibatis-3/version.properties
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/version.properties?rev=746636&r1=746635&r2=746636&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/version.properties (original)
+++ ibatis/trunk/java/ibatis-3/version.properties Sun Feb 22 04:52:12 2009
@@ -1,5 +1,5 @@
-#Build version info
-#Fri Feb 20 23:51:43 MST 2009
-version=3.0.0
-buildDate=2009/02/20 23\:51
-buildNum=127
+#Build version info
+#Sat Feb 21 21:47:38 MST 2009
+version=3.0.0
+buildDate=2009/02/21 21\:47
+buildNum=131



Mime
View raw message