commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bali...@apache.org
Subject cvs commit: jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl ContextImpl.java PersistenceManagerImpl.java
Date Sat, 20 Jul 2002 13:53:48 GMT
baliuka     2002/07/20 06:53:48

  Modified:    simplestore/src/java/org/apache/commons/simplestore/persistence
                        Context.java PersistenceManager.java
               simplestore/src/java/org/apache/commons/simplestore/persistence/impl
                        ContextImpl.java PersistenceManagerImpl.java
  Log:
  Added methods for query support
  
  Revision  Changes    Path
  1.7       +2 -1      jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/Context.java
  
  Index: Context.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/Context.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Context.java	9 Jun 2002 08:01:31 -0000	1.6
  +++ Context.java	20 Jul 2002 13:53:48 -0000	1.7
  @@ -111,5 +111,6 @@
      public TypeConverter getTypeConverter();
      
      
  +   public QueryManager getQueryManager();
   }
   
  
  
  
  1.6       +10 -1     jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/PersistenceManager.java
  
  Index: PersistenceManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/PersistenceManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PersistenceManager.java	20 Apr 2002 10:30:18 -0000	1.5
  +++ PersistenceManager.java	20 Jul 2002 13:53:48 -0000	1.6
  @@ -150,5 +150,14 @@
        * @return true if object deleted
        */    
       public boolean isDeleted(Object pc);
  +    
  +    
  +    
  +    public Query newQuery(Class candidates, String lang, String queryString );
  +    
  +    
  +     
  +    
  +    
   }
   
  
  
  
  1.7       +10 -3     jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/ContextImpl.java
  
  Index: ContextImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/ContextImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ContextImpl.java	9 Jun 2002 08:01:31 -0000	1.6
  +++ ContextImpl.java	20 Jul 2002 13:53:48 -0000	1.7
  @@ -64,7 +64,7 @@
    *     baliuka@mwm.lt</a>
    *@version    $Id$
    */
  -public class ContextImpl implements Context {
  +public final class ContextImpl implements Context {
       
       final MetaClass metaClass;
       final Storage storage;
  @@ -72,6 +72,7 @@
       final TransactionManager transactionManager;
       final TypeConverter typeConverter;
       final OIDGenerator  generator;
  +    final QueryManager qm;
       
       /** Creates new ContextImpl */
       public ContextImpl( MetaClass metaClass,TypeConverter typeConverter,
  @@ -90,7 +91,10 @@
           generator.setContext( this );
           typeConverter.setContext( this );
           transactionManager.setContext( this );
  -      
  +       if( storage instanceof QueryManager  ){
  +          qm = (QueryManager)storage;
  +          qm.setContext(this);
  +       }else qm = null;
       }
       
       public MetaClass getMetaClass(Class clasz) {
  @@ -117,5 +121,8 @@
           return typeConverter;
       }
       
  +    public QueryManager getQueryManager() {
  +        return qm;
  +    }    
       
   }
  
  
  
  1.9       +8 -10     jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/PersistenceManagerImpl.java
  
  Index: PersistenceManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/PersistenceManagerImpl.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PersistenceManagerImpl.java	16 Jun 2002 10:26:46 -0000	1.8
  +++ PersistenceManagerImpl.java	20 Jul 2002 13:53:48 -0000	1.9
  @@ -56,15 +56,7 @@
   
   import org.apache.commons.simplestore.cache.Cache;
   import org.apache.commons.simplestore.cache.impl.SoftRefMemoryCache;
  -import org.apache.commons.simplestore.persistence.MetaObject;
  -import org.apache.commons.simplestore.persistence.Persistent;
  -import org.apache.commons.simplestore.persistence.Storage;
  -import org.apache.commons.simplestore.persistence.StorageException;
  -import org.apache.commons.simplestore.persistence.Transaction;
  -import org.apache.commons.simplestore.persistence.TransactionManager;
  -import org.apache.commons.simplestore.persistence.Context;
  -import org.apache.commons.simplestore.persistence.PersistenceManager;
  -import org.apache.commons.simplestore.persistence.EnumeratorCallback;
  +import org.apache.commons.simplestore.persistence.*;
   
   import java.math.BigInteger;
   import java.util.HashMap;
  @@ -175,6 +167,12 @@
           context.getStorage().enumerate(clasz, callback);
            
      }
  +    
  +    public Query newQuery(Class candidates, String lang, String queryString) {
  +        
  +        return context.getQueryManager().newQuery(candidates, lang, queryString);
  +        
  +    }
       
   }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message