Subversion Repositories SmartDukaan

Rev

Rev 31495 | Rev 31498 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31495 Rev 31497
Line 238... Line 238...
238
	public String addBrands(HttpServletRequest request, Model model) throws Exception {
238
	public String addBrands(HttpServletRequest request, Model model) throws Exception {
239
 
239
 
240
		List<DBObject> mobileBrands = mongoClient.getAllBrandsToDisplay(6);
240
		List<DBObject> mobileBrands = mongoClient.getAllBrandsToDisplay(6);
241
		for (DBObject mobileBrand : mobileBrands) {
241
		for (DBObject mobileBrand : mobileBrands) {
242
			String brandName = (String) mobileBrand.get("name");
242
			String brandName = (String) mobileBrand.get("name");
243
			// Brand brand = brandsRepository.selectByBrand(brandName);
243
			BrandCatalog brand = brandsRepository.selectByBrand(brandName);
244
 
244
 
-
 
245
			if (brand == null) {
245
			BrandCatalog brand = new BrandCatalog();
246
				brand = new BrandCatalog();
246
			brand.setName(brandName);
247
				brand.setName(brandName);
247
			brand.setLogoUrl((String) mobileBrand.get("url"));
248
				brand.setLogoUrl((String) mobileBrand.get("url"));
248
			brandsRepository.persist(brand);
249
				brandsRepository.persist(brand);
-
 
250
			}
249
 
251
 
250
			LOGGER.info("brand {}", brand);
252
			LOGGER.info("brand {}", brand);
251
 
253
 
252
			Double category = (Double) mobileBrand.get("categoryId");
254
			Double category = (Double) mobileBrand.get("categoryId");
253
 
255