Subversion Repositories SmartDukaan

Rev

Rev 2768 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2768 Rev 2838
Line 1... Line 1...
1
package in.shop2020.storage.bdb;
1
package in.shop2020.storage.bdb;
2
 
2
 
3
import in.shop2020.metamodel.core.Brand;
3
import in.shop2020.metamodel.core.SpecialPage;
4
import in.shop2020.metamodel.core.Entity;
4
import in.shop2020.metamodel.core.Entity;
5
import in.shop2020.metamodel.core.EntityState;
5
import in.shop2020.metamodel.core.EntityState;
6
import in.shop2020.metamodel.core.Helpdoc;
6
import in.shop2020.metamodel.core.Helpdoc;
7
 
7
 
8
import com.sleepycat.bind.EntryBinding;
8
import com.sleepycat.bind.EntryBinding;
Line 14... Line 14...
14
public class ContentViews {
14
public class ContentViews {
15
 
15
 
16
    private StoredMap entityMap;
16
    private StoredMap entityMap;
17
    private StoredMap entityMetadataMap;
17
    private StoredMap entityMetadataMap;
18
    private StoredMap helpdocMap;
18
    private StoredMap helpdocMap;
19
    private StoredMap<Long, Brand> brandMap;
19
    private StoredMap<Long, SpecialPage> specialPagesMap;
20
    private StoredMap dataObjectMap;
20
    private StoredMap dataObjectMap;
21
    private StoredMap definitionMap;
21
    private StoredMap definitionMap;
22
 
22
 
23
    private StoredMap entityByCategoryMap;
23
    private StoredMap entityByCategoryMap;
24
    
24
    
Line 39... Line 39...
39
        EntryBinding entityMetadataDataBinding =  new SerialBinding(catalog, EntityState.class);
39
        EntryBinding entityMetadataDataBinding =  new SerialBinding(catalog, EntityState.class);
40
 
40
 
41
        EntryBinding helpdocKeyBinding = new SerialBinding(catalog, Long.class);
41
        EntryBinding helpdocKeyBinding = new SerialBinding(catalog, Long.class);
42
        EntryBinding helpdocDataBinding =  new SerialBinding(catalog, Helpdoc.class);
42
        EntryBinding helpdocDataBinding =  new SerialBinding(catalog, Helpdoc.class);
43
 
43
 
44
        EntryBinding<Long> brandKeyBinding  = new SerialBinding<Long>(catalog, Long.class);
44
        EntryBinding<Long> specialPageKeyBinding  = new SerialBinding<Long>(catalog, Long.class);
45
        EntryBinding<Brand> brandDataBinding =  new SerialBinding<Brand>(catalog, Brand.class);
45
        EntryBinding<SpecialPage> specialPageDataBinding =  new SerialBinding<SpecialPage>(catalog, SpecialPage.class);
46
 
46
 
47
        EntryBinding commonKeyBinding =   new SerialBinding(catalog, String.class);
47
        EntryBinding commonKeyBinding =   new SerialBinding(catalog, String.class);
48
        EntryBinding commonDataBinding =   new SerialBinding(catalog, Object.class);
48
        EntryBinding commonDataBinding =   new SerialBinding(catalog, Object.class);
49
        
49
        
50
        EntryBinding definitionKeyBinding =   new SerialBinding(catalog, String.class);
50
        EntryBinding definitionKeyBinding =   new SerialBinding(catalog, String.class);
Line 62... Line 62...
62
        
62
        
63
        entityMetadataMap = new StoredMap(db.getEntityMetadataDatabase(),entityMetadataKeyBinding, entityMetadataDataBinding, true);
63
        entityMetadataMap = new StoredMap(db.getEntityMetadataDatabase(),entityMetadataKeyBinding, entityMetadataDataBinding, true);
64
        
64
        
65
        helpdocMap = new StoredMap(db.getHelpdocDatabase(), helpdocKeyBinding, helpdocDataBinding, true);
65
        helpdocMap = new StoredMap(db.getHelpdocDatabase(), helpdocKeyBinding, helpdocDataBinding, true);
66
        
66
        
67
        brandMap = new StoredMap<Long, Brand>(db.getBrandDatabase(), brandKeyBinding, brandDataBinding, true);
67
        specialPagesMap = new StoredMap<Long, SpecialPage>(db.getSpecialPageDatabase(), specialPageKeyBinding, specialPageDataBinding, true);
68
 
68
 
69
        dataObjectMap = new StoredMap(db.getDataObjectDatabase(), commonKeyBinding, commonDataBinding, true);
69
        dataObjectMap = new StoredMap(db.getDataObjectDatabase(), commonKeyBinding, commonDataBinding, true);
70
        
70
        
71
        definitionMap = new StoredMap(db.getDefinitionDatabase(), definitionKeyBinding, definitionDataBinding, true);
71
        definitionMap = new StoredMap(db.getDefinitionDatabase(), definitionKeyBinding, definitionDataBinding, true);
72
        
72
        
Line 113... Line 113...
113
 
113
 
114
        return helpdocMap;
114
        return helpdocMap;
115
    }
115
    }
116
 
116
 
117
    /**
117
    /**
118
     * Return a map view of the brand storage container.
118
     * Return a map view of the special page storage container.
119
     */
119
     */
120
    public final StoredMap<Long, Brand> getBrandMap() {
120
    public final StoredMap<Long, SpecialPage> getSpecialPagesMap() {
121
        return brandMap;
121
        return specialPagesMap;
122
    }
122
    }
123
 
123
 
124
    /**
124
    /**
125
     * Return a map view of the definition storage container.
125
     * Return a map view of the definition storage container.
126
     */
126
     */