001    package org.nakedobjects.applib;
002    
003    public abstract class AbstractFactoryAndRepository extends AbstractService {
004    
005        // {{ newPersistenceInstance, newInstance
006        /**
007         * Returns a new instance of the specified class that will have been persisted.
008         * 
009         * <p>
010         * This method isn't quite deprecated, but generally consider using
011         * {@link #newTransientInstance(Class)} instead.
012         */
013        protected <T> T newPersistentInstance(final Class<T> ofClass) {
014            return getContainer().newPersistentInstance(ofClass);
015        }
016        /**
017         * Returns a new instance of the specified class that has the sane persisted state as the specified object.
018         * 
019         * <p>
020         * This method isn't quite deprecated, but generally consider using
021         * {@link #newTransientInstance(Class)} instead.
022         */
023        protected <T> T newInstance(final Class<T> ofClass, final Object object) {
024            return getContainer().newInstance(ofClass, object);
025        }
026        // }}
027        
028    
029            
030    }
031    
032    // Copyright (c) Naked Objects Group Ltd.