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 DBStorage.java DefaultTypeConverter.java PersistenceManagerImpl.java PersistenceManager.java
Date Sat, 23 Mar 2002 14:54:53 GMT
baliuka     02/03/23 06:54:53

  Modified:    simplestore/src/java/org/apache/commons/simplestore/persistence
                        Context.java OIDGenerator.java
                        PersistenceManager.java
                        PersistenceManagerFactory.java Persistent.java
                        SimplestoreException.java Storage.java
                        Transaction.java TypeConverter.java Validator.java
               simplestore/src/java/org/apache/commons/simplestore/persistence/impl
                        ContextImpl.java DBStorage.java
                        DefaultTypeConverter.java
                        PersistenceManagerImpl.java
  Removed:     simplestore/src/java/org/apache/commons/simplestore/persistence/impl
                        PersistenceManager.java
  Log:
  cleanup
  
  Revision  Changes    Path
  1.4       +5 -2      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Context.java	20 Mar 2002 19:28:26 -0000	1.3
  +++ Context.java	23 Mar 2002 14:54:52 -0000	1.4
  @@ -59,7 +59,7 @@
   
   /** This interface used by Persistence implementation to
    * implement interfaces like OIDGenerator
  - *
  + * <pre>
    *
    *    MetaClassImpl mclass = new MetaClassImpl( MetaClassImpl.class.getClassLoader());
    *       DBStorage storage = new DBStorage( db );
  @@ -71,9 +71,10 @@
    *                       storage );
    *       pm = PersistenceManagerImpl.getPersistenceManager(context);
    *   
  + * </pre>
    * @author Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - * @version $Id: Context.java,v 1.3 2002/03/20 19:28:26 baliuka Exp $
  + * @version $Id: Context.java,v 1.4 2002/03/23 14:54:52 baliuka Exp $
    */
   
   public interface Context {
  @@ -103,6 +104,8 @@
       * @return OIDGenerator
       */   
      public OIDGenerator getOIDGenerator();
  +   
  +   public TypeConverter getTypeConverter();
   
   }
   
  
  
  
  1.5       +4 -1      jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/OIDGenerator.java
  
  Index: OIDGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/OIDGenerator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- OIDGenerator.java	20 Mar 2002 19:28:26 -0000	1.4
  +++ OIDGenerator.java	23 Mar 2002 14:54:52 -0000	1.5
  @@ -55,9 +55,12 @@
   package org.apache.commons.simplestore.persistence;
   
   /** This interface used to implement OID generator
  + * Use this interface in <code>PersistentManager</code>
  + * implementation to plug custom generator for Persistent
  + * object identity in storage
    * @author Gerhard Froehlich <a href="mailto:g-froehlich@gmx.de">
    *      g-froehlich@gmx.de</a>
  - * @version $Id: OIDGenerator.java,v 1.4 2002/03/20 19:28:26 baliuka Exp $
  + * @version $Id: OIDGenerator.java,v 1.5 2002/03/23 14:54:52 baliuka Exp $
    */
   public interface OIDGenerator {
   
  
  
  
  1.3       +9 -5      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PersistenceManager.java	20 Mar 2002 19:28:26 -0000	1.2
  +++ PersistenceManager.java	23 Mar 2002 14:54:52 -0000	1.3
  @@ -56,7 +56,7 @@
   
   /** This interface is designed for Simplestore user,
    * use PersistentManagerFactory to setup PersistentManager
  - *
  + *   <pre>
    * 
    *       DBPersistenceManagerFactory factory = new DBPersistenceManagerFactory();
    *       factory.setDriver("org.hsqldb.jdbcDriver");
  @@ -67,12 +67,12 @@
    *       factory.setMetaResource("org/apache/commons/simplestore/storage.xml");
    *       pm = factory.getPersistenceManager();
    *   
  - *
  + * </pre>
    *
    *
    * @author Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - * @version $Id: PersistenceManager.java,v 1.2 2002/03/20 19:28:26 baliuka Exp $
  + * @version $Id: PersistenceManager.java,v 1.3 2002/03/23 14:54:52 baliuka Exp $
    */
   public interface PersistenceManager {
   
  @@ -84,14 +84,14 @@
       public Transaction getTransaction(); 
   
       /** returns OID if object is persistent
  -     *
  +     *  <pre>
        *      Transaction transaction = pm.getTransaction();
        *       transaction.begin();
        *         MyObject object = (MyObject) pm.createInstance(MyObject.class);
        *         Object oid = pm.getOID(object);
        *         object.doSomething(oid,object);
        *       transaction.commit();
  -     *
  +     * </pre>
        * @param pc Persistent Object
        * @return OID
        */    
  @@ -112,6 +112,7 @@
       public Object findInstance( Class clasz, Object oid ) throws StorageException; 
   
       /** Finds All Persistent insatnces of Class
  +     * <pre>
        *    transaction.begin();
        *   java.util.Set objects = pm.findAll(MyObject.class);
        *    System.out.println("Found " + objects.size() + " objects of type " + MyObject.class);
  @@ -121,6 +122,7 @@
        *     object.doSomething();
        *  }
        *  transaction.commit();
  +     * </pre>
        * @param clasz Type
        * @throws StorageException Storage specific Exception
        * @return Collection persistent objects
  @@ -132,6 +134,8 @@
        */    
       public void removeInstance(Object pc);
   
  +    public boolean isNew(Object pc);
       
  +    public boolean isDeleted(Object pc);
   }
   
  
  
  
  1.3       +3 -3      jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/PersistenceManagerFactory.java
  
  Index: PersistenceManagerFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/PersistenceManagerFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PersistenceManagerFactory.java	20 Mar 2002 19:28:26 -0000	1.2
  +++ PersistenceManagerFactory.java	23 Mar 2002 14:54:52 -0000	1.3
  @@ -57,7 +57,7 @@
   /**
    * This interface used by Persitence implementation user to
    * setup PersistenceManager
  - *
  + * <pre>
    *    DBPersistenceManagerFactory factory = new DBPersistenceManagerFactory();
    *       factory.setDriver("org.hsqldb.jdbcDriver");
    *       factory.setUrl("jdbc:hsqldb:sample");
  @@ -66,13 +66,13 @@
    *       factory.setMaxConnections(1);
    *       factory.setMetaResource("org/apache/commons/simplestore/storage.xml");
    *       pm = factory.getPersistenceManager();
  - *
  + * </pre>
    * User can implement this interface to add custom OIDGenerator, Storage,
    * TransactionManager implementation    
    *
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: PersistenceManagerFactory.java,v 1.2 2002/03/20 19:28:26 baliuka Exp
$
  + *@version    $Id: PersistenceManagerFactory.java,v 1.3 2002/03/23 14:54:52 baliuka Exp
$
    */
   public interface PersistenceManagerFactory {
   
  
  
  
  1.5       +1 -2      jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/Persistent.java
  
  Index: Persistent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/Persistent.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Persistent.java	20 Mar 2002 19:28:26 -0000	1.4
  +++ Persistent.java	23 Mar 2002 14:54:52 -0000	1.5
  @@ -56,11 +56,10 @@
   
   /**
    * All persitent objects in SimpleStore implement this interface
  - * this interface
    * hashCode and equals methods are implemented by Enhancer
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: Persistent.java,v 1.4 2002/03/20 19:28:26 baliuka Exp $
  + *@version    $Id: Persistent.java,v 1.5 2002/03/23 14:54:52 baliuka Exp $
    */
   
   public interface Persistent {
  
  
  
  1.2       +4 -2      jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/SimplestoreException.java
  
  Index: SimplestoreException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/SimplestoreException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimplestoreException.java	14 Mar 2002 15:44:02 -0000	1.1
  +++ SimplestoreException.java	23 Mar 2002 14:54:52 -0000	1.2
  @@ -56,11 +56,13 @@
   package org.apache.commons.simplestore.persistence;
   
   /**
  - * Meta data
  + * Persistent object throws this exception if
  + * <code>Validator</code> returns false in
  + * <code>isValid()</code>
    *
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *     baliuka@mwm.lt</a>
  - *@version    $Id: SimplestoreException.java,v 1.1 2002/03/14 15:44:02 baliuka Exp $
  + *@version    $Id: SimplestoreException.java,v 1.2 2002/03/23 14:54:52 baliuka Exp $
    */
   public class SimplestoreException extends java.lang.RuntimeException {
       
  
  
  
  1.5       +3 -5      jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/Storage.java
  
  Index: Storage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/Storage.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Storage.java	11 Mar 2002 09:53:07 -0000	1.4
  +++ Storage.java	23 Mar 2002 14:54:52 -0000	1.5
  @@ -59,9 +59,11 @@
   import java.util.Set;
   
   /**
  + * This interface is resource abstraction
  + *
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: Storage.java,v 1.4 2002/03/11 09:53:07 baliuka Exp $
  + *@version    $Id: Storage.java,v 1.5 2002/03/23 14:54:52 baliuka Exp $
    */
   
   public interface Storage {
  @@ -70,13 +72,9 @@
   
       public Object retrieveObject(Class clasz, Object id) throws StorageException;
   
  -    public void registerClass(Class clasz) throws StorageException;
  -
       public void setContext(Context context );
   
       public Set retrieveAll(Class clasz) throws StorageException;
  -
  -    public Set query(Class clasz, String procName, Object[] args) throws StorageException;
   
       public void close() throws StorageException;
       
  
  
  
  1.2       +3 -1      jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/Transaction.java
  
  Index: Transaction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/Transaction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Transaction.java	11 Feb 2002 20:23:30 -0000	1.1
  +++ Transaction.java	23 Mar 2002 14:54:52 -0000	1.2
  @@ -55,9 +55,11 @@
   package org.apache.commons.simplestore.persistence;
   
   /**
  + * Local transaction, used then storageis transaction manager itself
  + *
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: Transaction.java,v 1.1 2002/02/11 20:23:30 froehlich Exp $
  + *@version    $Id: Transaction.java,v 1.2 2002/03/23 14:54:52 baliuka Exp $
    */
   public interface Transaction {
   
  
  
  
  1.4       +4 -6      jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/TypeConverter.java
  
  Index: TypeConverter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/TypeConverter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TypeConverter.java	17 Feb 2002 14:09:03 -0000	1.3
  +++ TypeConverter.java	23 Mar 2002 14:54:52 -0000	1.4
  @@ -59,15 +59,13 @@
    *
    *@author     Gerhard Froehlich <a href="mailto:g-froehlich@gmx.de">
    *     g-froehlich@gmx.de</a>
  - *@version    $Id: TypeConverter.java,v 1.3 2002/02/17 14:09:03 baliuka Exp $
  + *@version    $Id: TypeConverter.java,v 1.4 2002/03/23 14:54:52 baliuka Exp $
    */
   
   public interface TypeConverter {
  -    
  -     public Object convertNumber(Number number, Class clazz);
  +         
  +     public Object toAppType(Object object , Class clazz);
        
  -     public Object convertPrimitives(Number number, Class clazz);
  -     
  -     public Object convert(Object object , Class clazz);
  +     public Object toStorageType(Object object , Class clazz);
        
   }
  
  
  
  1.2       +7 -1      jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/Validator.java
  
  Index: Validator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/Validator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Validator.java	10 Mar 2002 18:37:17 -0000	1.1
  +++ Validator.java	23 Mar 2002 14:54:52 -0000	1.2
  @@ -54,9 +54,15 @@
    */
   package org.apache.commons.simplestore.persistence;
   /**
  + * <p>
  + * Validates Pesrsitent properties, class generated
  + * by SimpleStore throws <code>ValidationException</code> 
  + * if <code>isValid()</code> returns false, this Exception contains all information
  + * about invalid property. It is recommended to use global
  + * exeption handler to hanle all validation exceptions
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: Validator.java,v 1.1 2002/03/10 18:37:17 baliuka Exp $
  + *@version    $Id: Validator.java,v 1.2 2002/03/23 14:54:52 baliuka Exp $
    */
   public interface Validator {
       
  
  
  
  1.3       +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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ContextImpl.java	17 Mar 2002 13:36:25 -0000	1.2
  +++ ContextImpl.java	23 Mar 2002 14:54:53 -0000	1.3
  @@ -62,7 +62,7 @@
    *
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *     baliuka@mwm.lt</a>
  - *@version    $Id: ContextImpl.java,v 1.2 2002/03/17 13:36:25 baliuka Exp $
  + *@version    $Id: ContextImpl.java,v 1.3 2002/03/23 14:54:53 baliuka Exp $
    */
   public class ContextImpl implements Context {
       
  @@ -70,10 +70,13 @@
       Storage storage;
       Cache cache;
       TransactionManager transactionManager;
  +    TypeConverter typeConverter;
       OIDGenerator  generator;
       
       /** Creates new ContextImpl */
  -    public ContextImpl( MetaClass metaClass, OIDGenerator  generator, Storage storage,
Cache cache,TransactionManager transactionManager  ) {
  +    public ContextImpl( MetaClass metaClass,TypeConverter typeConverter,
  +          OIDGenerator  generator, Storage storage,
  +          Cache cache,TransactionManager transactionManager  ) {
           metaClass.setContext( this );
           storage.setContext( this );
           this.generator = generator;
  @@ -81,7 +84,7 @@
           this.storage = storage;
           this.cache = cache;
           this.transactionManager = transactionManager;
  -        
  +        this.typeConverter = typeConverter;
       }
       
       public MetaClass getMetaClass(Class clasz) {
  @@ -102,6 +105,10 @@
         
       public OIDGenerator getOIDGenerator() {
           return generator;
  +    }
  +    
  +    public TypeConverter getTypeConverter() {
  +        return typeConverter;
       }
       
   }
  
  
  
  1.15      +4 -38     jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/DBStorage.java
  
  Index: DBStorage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/DBStorage.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- DBStorage.java	19 Mar 2002 12:49:30 -0000	1.14
  +++ DBStorage.java	23 Mar 2002 14:54:53 -0000	1.15
  @@ -86,7 +86,7 @@
   /**
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: DBStorage.java,v 1.14 2002/03/19 12:49:30 baliuka Exp $
  + *@version    $Id: DBStorage.java,v 1.15 2002/03/23 14:54:53 baliuka Exp $
    */
   public class DBStorage extends AbstractStorage implements org.apache.commons.simplestore.tools.Constants
{
       
  @@ -106,27 +106,11 @@
           this.ds = ds;
       }
       
  -    // TODO must be converter interface
  -    public static Object toSQLType(Object object) {
  -        
  -        if ( object == null ) {
  -            return null;
  -        }
  -        if (object instanceof Boolean) {
  -            boolean value = ((Boolean) object).booleanValue();
  -            return (value ? new Short((short) 1) : new Short((short) 0));
  -        }
  -        if (object instanceof java.util.Date && !(object instanceof java.sql.Date))
{
  -            return new java.sql.Date(((java.util.Date) object).getTime());
  -        }
  -        
  -        return object;
  +
  +    public  Object toSQLType(Object object) {
  +        return context.getTypeConverter().toStorageType(object,null);
       }
       
  -    
  -    
  -    
  -    
       private  int excecute( String sql, Object[] args, ResultSetHandler eh) throws StorageException
{
           
           Connection connection =  getConnection();
  @@ -192,24 +176,6 @@
           this.context = context;
       }
       
  -    
  -    //TODO : must be removed
  -    public void registerClass(Class clasz) {
  -        
  -        try {
  -            
  -            ResourceBundle bundle = ResourceBundle.getBundle(clasz.getName() + "Procedures");
  -            Enumeration enum = bundle.getKeys();
  -            
  -            while (enum.hasMoreElements()) {
  -                Object key = enum.nextElement();
  -                procedures.setProperty(key.toString(), bundle.getString(key.toString()));
  -            }
  -            
  -        } catch (Exception e) {
  -            e.printStackTrace();
  -        }
  -    }
       
       public Object retrieveObject( final Class clasz, Object id ) throws StorageException
{
           
  
  
  
  1.4       +19 -9     jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/DefaultTypeConverter.java
  
  Index: DefaultTypeConverter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/DefaultTypeConverter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultTypeConverter.java	17 Feb 2002 14:09:04 -0000	1.3
  +++ DefaultTypeConverter.java	23 Mar 2002 14:54:53 -0000	1.4
  @@ -61,7 +61,7 @@
    *
    *@author     Gerhard Froehlich <a href="mailto:g-froehlich@gmx.de">
    *     g-froehlich@gmx.de</a>
  - *@version    $Id: DefaultTypeConverter.java,v 1.3 2002/02/17 14:09:04 baliuka Exp $
  + *@version    $Id: DefaultTypeConverter.java,v 1.4 2002/03/23 14:54:53 baliuka Exp $
    */
   
   public class DefaultTypeConverter implements TypeConverter {
  @@ -117,13 +117,16 @@
       }
       
       
  -     public Object convert(Object object, Class cls) {
  +     public Object toAppType(Object object, Class cls) {
          
               
               if (object == null) {
                   return null;
               }
               
  +            if( object.getClass() == cls )
  +                return object;
  +            
               if ( cls.isAssignableFrom( object.getClass() )) {
                   return object;
               }
  @@ -136,18 +139,25 @@
                   return convertPrimitives((Number) object, cls);
               }
               
  -            if (cls.equals(Boolean.class) && object instanceof Number) {
  -                return new Boolean(((Number) object).intValue() != 0);
  -            }
  -            
  -            if (cls.equals(Character.TYPE)) {
  -                return new Character(object.toString().charAt(0));
  -            }
               
           return object;
       }
       
  + public Object toStorageType(Object object, Class cls) {
  +     
  +      if ( object == null ) {
  +            return null;
  +        }
  +        if (object instanceof Boolean) {
  +            boolean value = ((Boolean) object).booleanValue();
  +            return (value ? new Short((short) 1) : new Short((short) 0));
  +        }
  +        if (object instanceof java.util.Date && !(object instanceof java.sql.Date))
{
  +            return new java.sql.Date(((java.util.Date) object).getTime());
  +        }
       
  +   return object;
  + }    
       
   }
   
  
  
  
  1.2       +11 -3     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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PersistenceManagerImpl.java	17 Mar 2002 17:35:48 -0000	1.1
  +++ PersistenceManagerImpl.java	23 Mar 2002 14:54:53 -0000	1.2
  @@ -72,7 +72,7 @@
   /**
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: PersistenceManagerImpl.java,v 1.1 2002/03/17 17:35:48 baliuka Exp $
  + *@version    $Id: PersistenceManagerImpl.java,v 1.2 2002/03/23 14:54:53 baliuka Exp $
    */
   
   public class PersistenceManagerImpl implements PersistenceManager{
  @@ -128,8 +128,16 @@
           }
       }
   
  -    public void registerClass(Class clasz) throws StorageException {
  -        context.getStorage().registerClass(clasz);
  +    public boolean isNew(Object pc) {
  +        
  +        return ((Persistent)pc).getMetaObject().isNew();
  +        
       }
  +    
  +    public boolean isDeleted(Object pc) {
  +        
  +        return ((Persistent)pc).getMetaObject().isDeleted();
  +    }
  +    
   }
   
  
  
  

--
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