1 2 12 package com.versant.core.jdo.sco; 13 14 import com.versant.core.jdo.VersantPersistenceManager; 15 import com.versant.core.jdo.VersantStateManager; 16 import com.versant.core.common.VersantFieldMetaData; 17 import com.versant.core.common.Utils; 18 import com.versant.core.metadata.FieldMetaData; 19 import com.versant.core.common.BindingSupportImpl; 20 21 import javax.jdo.spi.PersistenceCapable; 22 import java.io.Serializable ; 23 import java.util.Collection ; 24 25 28 public class SCOTreeSetFactory implements VersantSCOCollectionFactory, 29 Serializable { 30 31 38 public VersantSimpleSCO createSCOCollection(PersistenceCapable owner, 39 VersantPersistenceManager pm, VersantStateManager stateManager, 40 VersantFieldMetaData fmd, CollectionData collectionData) { 41 int n = collectionData.valueCount; 42 Object [] originalData = new Object [n]; 43 originalData = Utils.getObjectsById(collectionData.values, 44 collectionData.valueCount, pm, (FieldMetaData) fmd, 45 fmd.isElementTypePC()); 46 return new SCOTreeSet(owner, stateManager, fmd, originalData); 47 } 48 49 53 public VersantSimpleSCO createSCOCollection(PersistenceCapable owner, 54 VersantPersistenceManager pm, VersantStateManager stateManager, 55 VersantFieldMetaData fmd, Collection collection) { 56 return new SCOTreeSet(owner, stateManager, fmd, collection.toArray()); 57 } 58 59 60 } 61 | Popular Tags |