1 8 9 package com.sleepycat.persist.raw; 10 11 import com.sleepycat.je.DatabaseException; 12 import com.sleepycat.je.Environment; 13 import com.sleepycat.persist.PrimaryIndex; 14 import com.sleepycat.persist.SecondaryIndex; 15 import com.sleepycat.persist.StoreConfig; 16 import com.sleepycat.persist.evolve.Mutations; 17 import com.sleepycat.persist.impl.Store; 18 import com.sleepycat.persist.model.EntityModel; 19 20 44 public class RawStore { 45 46 private Store store; 47 48 62 public RawStore(Environment env, String storeName, StoreConfig config) 63 throws DatabaseException { 64 65 store = new Store(env, storeName, config, true ); 66 } 67 68 71 public PrimaryIndex<Object ,RawObject> getPrimaryIndex(String entityClass) 72 throws DatabaseException { 73 74 return store.getPrimaryIndex 75 (Object .class, null, RawObject.class, entityClass); 76 } 77 78 82 public SecondaryIndex<Object ,Object ,RawObject> 83 getSecondaryIndex(String entityClass, String keyName) 84 throws DatabaseException { 85 86 return store.getSecondaryIndex 87 (getPrimaryIndex(entityClass), RawObject.class, entityClass, 88 Object .class, null, keyName); 89 } 90 91 94 public Environment getEnvironment() { 95 return store.getEnvironment(); 96 } 97 98 101 public StoreConfig getConfig() { 102 return store.getConfig(); 103 } 104 105 108 public String getStoreName() { 109 return store.getStoreName(); 110 } 111 112 115 public EntityModel getModel() { 116 return store.getModel(); 117 } 118 119 122 public Mutations getMutations() { 123 return store.getMutations(); 124 } 125 126 130 public void close() 131 throws DatabaseException { 132 133 store.close(); 134 } 135 } 136 | Popular Tags |