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