List:Commits« Previous MessageNext Message »
From:Craig L Russell Date:June 10 2010 1:02am
Subject:bzr push into clusterj branch (Craig.Russell:280 to 281)
View as plain text  
  281 Craig L Russell	2010-06-09
      Add query builder methods to SessionSPI

    modified:
      clusterj-core/src/main/java/com/mysql/clusterj/core/SessionImpl.java
      clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainTypeHandlerImpl.java
      clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/DomainTypeHandlerImpl.java
      clusterj-core/src/main/java/com/mysql/clusterj/core/query/QueryBuilderImpl.java
      clusterj-core/src/main/java/com/mysql/clusterj/core/query/QueryDomainTypeImpl.java
      clusterj-core/src/main/java/com/mysql/clusterj/core/spi/SessionSPI.java
  280 Craig L Russell	2010-06-08
      Update pom.xml to 7.1.5-SNAPSHOT

    modified:
      clusterj-api/pom.xml
      clusterj-bindings/pom.xml
      clusterj-core/pom.xml
      clusterj-jpatest/pom.xml
      clusterj-openjpa/pom.xml
      clusterj-test/pom.xml
      clusterj-tie/pom.xml
      pom.xml
=== modified file 'clusterj-core/src/main/java/com/mysql/clusterj/core/SessionImpl.java'
--- a/clusterj-core/src/main/java/com/mysql/clusterj/core/SessionImpl.java	2010-01-04 23:54:44 +0000
+++ b/clusterj-core/src/main/java/com/mysql/clusterj/core/SessionImpl.java	2010-06-10 01:02:24 +0000
@@ -52,6 +52,7 @@ import com.mysql.clusterj.core.util.Logg
 
 import com.mysql.clusterj.query.QueryBuilder;
 import com.mysql.clusterj.query.QueryDefinition;
+import com.mysql.clusterj.query.QueryDomainType;
 
 import java.util.ArrayList;
 import java.util.BitSet;
@@ -1068,4 +1069,9 @@ public class SessionImpl implements Sess
         clusterTransaction.executeNoCommit();
     }
 
+    public QueryDomainType<?> createQueryDomainType(DomainTypeHandler<?> domainTypeHandler) {
+        QueryBuilderImpl builder = (QueryBuilderImpl)getQueryBuilder();
+        return builder.createQueryDefinition(domainTypeHandler);
+    }
+
 }

=== modified file 'clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainTypeHandlerImpl.java'
--- a/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainTypeHandlerImpl.java	2010-05-29 00:36:43 +0000
+++ b/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainTypeHandlerImpl.java	2010-06-10 01:02:24 +0000
@@ -50,7 +50,7 @@ import com.mysql.clusterj.core.util.Logg
  * handlers for persistent field values. Subclasses will implement behavior
  * specific to the actual representations of persistence.
  */
-public abstract class AbstractDomainTypeHandlerImpl implements DomainTypeHandler {
+public abstract class AbstractDomainTypeHandlerImpl<T> implements DomainTypeHandler<T> {
 
     /** My message translator */
     protected static final I18NHelper local = I18NHelper.getInstance(AbstractDomainTypeHandlerImpl.class);
@@ -371,7 +371,7 @@ public abstract class AbstractDomainType
         throw new ClusterJFatalInternalException(local.message("ERR_Implementation_Should_Not_Occur"));
     }
 
-    public Object getInstance(ValueHandler handler) {
+    public T getInstance(ValueHandler handler) {
         throw new ClusterJFatalInternalException(local.message("ERR_Implementation_Should_Not_Occur"));
     }
 
@@ -379,7 +379,7 @@ public abstract class AbstractDomainType
         throw new ClusterJFatalInternalException(local.message("ERR_Implementation_Should_Not_Occur"));
     }
 
-    public Class<?> getProxyClass() {
+    public Class<T> getProxyClass() {
         throw new ClusterJFatalInternalException(local.message("ERR_Implementation_Should_Not_Occur"));
     }
 
@@ -391,7 +391,7 @@ public abstract class AbstractDomainType
         throw new ClusterJFatalInternalException(local.message("ERR_Implementation_Should_Not_Occur"));
     }
 
-    public Object newInstance() {
+    public T newInstance() {
         throw new ClusterJFatalInternalException(local.message("ERR_Implementation_Should_Not_Occur"));
     }
 

=== modified file 'clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/DomainTypeHandlerImpl.java'
--- a/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/DomainTypeHandlerImpl.java	2010-05-29 00:36:43 +0000
+++ b/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/DomainTypeHandlerImpl.java	2010-06-10 01:02:24 +0000
@@ -54,7 +54,7 @@ import java.util.Set;
  * similarly-named set method.
  * @param T the class of the persistence-capable type
  */
-public class DomainTypeHandlerImpl<T> extends AbstractDomainTypeHandlerImpl {
+public class DomainTypeHandlerImpl<T> extends AbstractDomainTypeHandlerImpl<T> {
 
     /** The domain class. */
     Class<T> cls;

=== modified file 'clusterj-core/src/main/java/com/mysql/clusterj/core/query/QueryBuilderImpl.java'
--- a/clusterj-core/src/main/java/com/mysql/clusterj/core/query/QueryBuilderImpl.java	2009-10-27 09:44:31 +0000
+++ b/clusterj-core/src/main/java/com/mysql/clusterj/core/query/QueryBuilderImpl.java	2010-06-10 01:02:24 +0000
@@ -45,4 +45,12 @@ public class QueryBuilderImpl implements
         return new QueryDomainTypeImpl<T>(domainTypeHandler, cls);
     }
 
+    /** Create a query definition for the domain type handler (no class mapping).
+     * @param domainTypeHandler the domain type handler
+     * @return the query definition
+     */
+    public <T> QueryDomainTypeImpl<T> createQueryDefinition(DomainTypeHandler<T> domainTypeHandler) {
+        return new QueryDomainTypeImpl<T>(domainTypeHandler);
+    }
+
 }

=== modified file 'clusterj-core/src/main/java/com/mysql/clusterj/core/query/QueryDomainTypeImpl.java'
--- a/clusterj-core/src/main/java/com/mysql/clusterj/core/query/QueryDomainTypeImpl.java	2010-04-20 20:57:07 +0000
+++ b/clusterj-core/src/main/java/com/mysql/clusterj/core/query/QueryDomainTypeImpl.java	2010-06-10 01:02:24 +0000
@@ -80,6 +80,10 @@ public class QueryDomainTypeImpl<T> impl
         this.domainTypeHandler = domainTypeHandler;
     }
 
+    public QueryDomainTypeImpl(DomainTypeHandler<T> domainTypeHandler) {
+        this.domainTypeHandler = domainTypeHandler;
+    }
+
     public PredicateOperand get(String propertyName) {
         // if called multiple times for the same property,
         // return the same PropertyImpl instance

=== modified file 'clusterj-core/src/main/java/com/mysql/clusterj/core/spi/SessionSPI.java'
--- a/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/SessionSPI.java	2009-10-27 09:44:31 +0000
+++ b/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/SessionSPI.java	2010-06-10 01:02:24 +0000
@@ -27,6 +27,7 @@ import com.mysql.clusterj.core.store.Ope
 import com.mysql.clusterj.core.store.ResultData;
 import com.mysql.clusterj.core.store.ScanOperation;
 import com.mysql.clusterj.core.store.Table;
+import com.mysql.clusterj.query.QueryDomainType;
 
 import java.util.BitSet;
 
@@ -78,4 +79,6 @@ public interface SessionSPI extends Sess
 
     Dictionary getDictionary();
 
+    QueryDomainType<?> createQueryDomainType(DomainTypeHandler<?> handler);
+
 }


Attachment: [text/bzr-bundle] bzr/craig.russell@oracle.com-20100610010224-llj32iw4gmsq2hr2.bundle
Thread
bzr push into clusterj branch (Craig.Russell:280 to 281)Craig L Russell10 Jun