protected Collection provideStateManagers(Collection pojos)
    {
    	PersistenceCapable pc;
    	int [] fieldNums;
    	Iterator iter = pojos.iterator();
    	Collection result = new ArrayList();
    	
    	while (iter.hasNext())
    	{
    		// obtain a StateManager
    		pc = (PersistenceCapable) iter.next();
    		Identity oid = new Identity(pc, broker);
    		StateManagerInternal smi = pmi.getStateManager(oid, pc.getClass()); 
    		
    		// fetch attributes into StateManager
			JDOClass jdoClass = Helper.getJDOClass(pc.getClass());
			fieldNums = jdoClass.getManagedFieldNumbers();

			FieldManager fm = new OjbFieldManager(pc, broker);
			smi.replaceFields(fieldNums, fm);
			smi.retrieve();
			
			// get JDO PersistencecCapable instance from SM and add it to result collection
			Object instance = smi.getObject();
			result.add(instance);
    	}
    	return result;   
	}
protected Collection provideStateManagers ( Collection pojos ) { PersistenceCapable pc ; int [ ] fieldNums ; Iterator iter = pojos . iterator ( ) ; Collection result = new ArrayList ( ) ; while ( iter . hasNext ( ) ) { pc = ( PersistenceCapable ) iter . next ( ) ; Identity oid = new Identity ( pc , broker ) ; StateManagerInternal smi = pmi . getStateManager ( oid , pc . getClass ( ) ) ; JDOClass jdoClass = Helper . getJDOClass ( pc . getClass ( ) ) ; fieldNums = jdoClass . getManagedFieldNumbers ( ) ; FieldManager fm = new OjbFieldManager ( pc , broker ) ; smi . replaceFields ( fieldNums , fm ) ; smi . retrieve ( ) ; Object instance = smi . getObject ( ) ; result . add ( instance ) ; } return result ; }
This methods enhances the objects loaded by a broker query
with a JDO StateManager an brings them under JDO control.
@param pojos the OJB pojos as obtained by the broker
@return the collection of JDO PersistenceCapable instances