1 2 12 package com.versant.core.jdo.sco.detached; 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.jdo.sco.VersantSCOMapFactory; 19 import com.versant.core.jdo.sco.VersantSimpleSCO; 20 import com.versant.core.jdo.sco.MapData; 21 import com.versant.core.metadata.FieldMetaData; 22 import com.versant.core.common.BindingSupportImpl; 23 24 import javax.jdo.spi.PersistenceCapable; 25 import java.io.Serializable ; 26 import java.util.Map ; 27 28 public class DetachSCOTreeMapFactory implements VersantSCOMapFactory, 29 Serializable { 30 31 public VersantSimpleSCO createSCOHashMap(PersistenceCapable owner, 32 VersantPersistenceManager pm, VersantStateManager stateManager, 33 VersantFieldMetaData fmd, MapData mapData) { 34 int n = mapData.entryCount; 35 Object [] keys = new Object [n]; 36 keys = Utils.getObjectsById(mapData.keys, mapData.entryCount, pm, 37 (FieldMetaData) fmd, fmd.isKeyTypePC()); 38 Object [] values = new Object [n]; 39 values = Utils.getObjectsById(mapData.values, mapData.entryCount, pm, 40 (FieldMetaData) fmd, fmd.isElementTypePC()); 41 mapData.keys = keys; 42 mapData.values = values; 43 return new DetachSCOTreeMap(owner, stateManager, fmd, mapData); 44 } 45 46 public VersantSimpleSCO createSCOHashMap(PersistenceCapable owner, 47 VersantPersistenceManager pm, VersantStateManager stateManager, 48 VersantFieldMetaData fmd, Map map) { 49 return new DetachSCOTreeMap(owner, stateManager, fmd, map); 50 } 51 52 53 } 54 | Popular Tags |