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.Map ; 24 25 28 public class SCOTreeMapFactory 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 SCOTreeMap(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 SCOTreeMap(owner, stateManager, fmd, map); 50 } 51 52 53 } 54 | Popular Tags |