Subversion Repositories SmartDukaan

Rev

Rev 2768 | Rev 3356 | Go to most recent revision | 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
import in.shop2020.util.Utils;
7
import in.shop2020.util.Utils;
8
 
8
 
Line 270... Line 270...
270
        	states.put(new Long(entityMetadata.getID()), entityMetadata);
270
        	states.put(new Long(entityMetadata.getID()), entityMetadata);
271
		}
271
		}
272
    }
272
    }
273
 
273
 
274
    /**
274
    /**
275
     * Returns all brands from the database.
275
     * Returns all special pages from the database.
276
     */
276
     */
277
    public Map<Long, Brand> getBrands() {
277
    public Map<Long, SpecialPage> getSpecialPages() {
278
        return views.getBrandMap();
278
        return views.getSpecialPagesMap();
279
    }
279
    }
280
 
280
 
281
    /**
281
    /**
282
     * Updates a given brand in the database.
282
     * Updates a given special page in the database.
283
     */
283
     */
284
    public void updateBrand(Brand brand) {
284
    public void updateSpecialPage(SpecialPage specialPage) {
285
        Map<Long, Brand> states = views.getBrandMap();
285
        Map<Long, SpecialPage> states = views.getSpecialPagesMap();
286
        states.put(new Long(brand.getID()), brand);
286
        states.put(new Long(specialPage.getID()), specialPage);
287
    }
287
    }
288
 
288
 
289
    /**
289
    /**
290
     * Returns a brand object given a id after looking it up from map
290
     * Returns a special page object given a id after looking it up from map
291
     * of values loaded from database.
291
     * of values loaded from database.
292
     */
292
     */
293
    public Brand getBrand(long brandId) {
293
    public SpecialPage getSpecialPage(long specialPageId) {
294
        return views.getBrandMap().get(brandId);
294
        return views.getSpecialPagesMap().get(specialPageId);
295
    }
295
    }
296
 
296
 
297
}
297
}