Skip to content

Commit f2f13e7

Browse files
committed
work
1 parent 91393ef commit f2f13e7

17 files changed

+70
-63
lines changed

src/main/java/org/woehlke/greenshop/oodm/admin/service/AdministratorServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ public List<Administrator> findAllAdministrators() {
3333

3434
@Override
3535
public Administrator findAdministratorById(long administratorId) {
36-
return administratorRepository.findOne(administratorId);
36+
return administratorRepository.getOne(administratorId);
3737
}
3838

3939
@Override
4040
@Transactional(readOnly=false,propagation=Propagation.REQUIRES_NEW)
4141
public void update(Administrator thisAdministrator) {
42-
Administrator original = administratorRepository.findOne(thisAdministrator.getId());
42+
Administrator original = administratorRepository.getOne(thisAdministrator.getId());
4343
if(original.getUserPassword().compareTo(thisAdministrator.getUserPassword())!=0){
4444
thisAdministrator.setUserPassword(encoder.encode(thisAdministrator.getUserPassword()));
4545
}

src/main/java/org/woehlke/greenshop/oodm/admin/service/TaxClassServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class TaxClassServiceImpl implements TaxClassService {
2424

2525
@Override
2626
public TaxClass findById(long taxClassId) {
27-
return taxClassRepository.findOne(taxClassId);
27+
return taxClassRepository.getOne(taxClassId);
2828
}
2929

3030
@Override

src/main/java/org/woehlke/greenshop/oodm/admin/service/TaxRateServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public Page<TaxRate> findAll(Pageable pageRequest) {
2828

2929
@Override
3030
public TaxRate findById(long taxRateId) {
31-
return taxRateRepository.findOne(taxRateId);
31+
return taxRateRepository.getOne(taxRateId);
3232
}
3333

3434
@Override

src/main/java/org/woehlke/greenshop/oodm/admin/service/TaxZone2ZoneServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ public List<TaxZone2Zone> findZonesByTaxZone(TaxZone thisTaxZone) {
5050

5151
@Override
5252
public TaxZone2Zone findTaxZone2ZoneById(long zoneId) {
53-
return taxZone2ZoneRepository.findOne(zoneId);
53+
return taxZone2ZoneRepository.getOne(zoneId);
5454
}
5555
}

src/main/java/org/woehlke/greenshop/oodm/admin/service/TaxZoneServiceImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ public TaxZone createTaxZone(TaxZone thisTaxZone) {
3636
@Override
3737
@Transactional(readOnly=false,propagation=Propagation.REQUIRES_NEW)
3838
public void deleteTaxZones(TaxZone thisTaxZone) {
39-
TaxZone tz =taxZoneRepository.findOne(thisTaxZone.getId());
39+
TaxZone tz =taxZoneRepository.getOne(thisTaxZone.getId());
4040
List<TaxZone2Zone> list = taxZone2ZoneRepository.findByTaxZone(tz);
41-
taxZone2ZoneRepository.delete(list);
41+
taxZone2ZoneRepository.deleteInBatch(list);
4242
taxZoneRepository.delete(tz);
4343
}
4444

4545
@Override
4646
@Transactional(readOnly=false,propagation=Propagation.REQUIRES_NEW)
4747
public void updateTaxZone(TaxZone thisTaxZone) {
48-
TaxZone tz =taxZoneRepository.findOne(thisTaxZone.getId());
48+
TaxZone tz =taxZoneRepository.getOne(thisTaxZone.getId());
4949
tz.setLastModified(new Date());
5050
tz.setName(thisTaxZone.getName());
5151
tz.setDescription(thisTaxZone.getDescription());
@@ -64,6 +64,6 @@ public Page<TaxZone> findAllTaxZones(Pageable pageRequest) {
6464

6565
@Override
6666
public TaxZone findTaxZoneById(long taxZoneId) {
67-
return taxZoneRepository.findOne(taxZoneId);
67+
return taxZoneRepository.getOne(taxZoneId);
6868
}
6969
}

src/main/java/org/woehlke/greenshop/oodm/catalog/CatalogServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ public ProductAttributes findProductOptionsByProduct(
5555
ProductOptionId oid = new ProductOptionId();
5656
oid.setId(pa.getOptionId());
5757
oid.setLanguage(language);
58-
ProductOption po = productOptionRepository.findOne(oid);
58+
ProductOption po = productOptionRepository.getOne(oid);
5959
ProductOptionValueId povid = new ProductOptionValueId();
6060
povid.setId(pa.getValueId());
6161
povid.setLanguage(language);
62-
ProductOptionValue pov = productOptionValueRepository.findOne(povid);
62+
ProductOptionValue pov = productOptionValueRepository.getOne(povid);
6363
ProductOptionAttribute poa = new ProductOptionAttribute();
6464
poa.setProductAttribute(pa);
6565
poa.setProductOption(po);

src/main/java/org/woehlke/greenshop/oodm/catalog/service/CategoryServiceImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ public ProductsByCategory getProductsByCategoryAndManufacturer(
210210
long categoryId, long manufacturerId, Language language) {
211211
ProductsByCategory productsByCategory = new ProductsByCategory();
212212
productsByCategory.setManufacturerId(manufacturerId);
213-
Category category = categoryRepository.findOne(categoryId);
214-
Manufacturer manufacturer = manufacturerRepository.findOne(manufacturerId);
213+
Category category = categoryRepository.getOne(categoryId);
214+
Manufacturer manufacturer = manufacturerRepository.getOne(manufacturerId);
215215
List<SpecialProduct> products = new ArrayList<SpecialProduct>();
216216
List<ProductDescription> productDescriptions=productDescriptionRepositoryDao.findByCategoryAndManufacturer(category,manufacturer,language);
217217
for(ProductDescription productDescription:productDescriptions){
@@ -232,7 +232,7 @@ public ProductsByCategory getProductsByCategoryAndManufacturer(
232232
CategoryDescriptionId categoryDescriptionId = new CategoryDescriptionId();
233233
categoryDescriptionId.setLanguage(language);
234234
categoryDescriptionId.setCategory(category);
235-
CategoryDescription thisCategory = categoryDescriptionRepository.findOne(categoryDescriptionId);
235+
CategoryDescription thisCategory = categoryDescriptionRepository.getOne(categoryDescriptionId);
236236
productsByCategory.setThisCategory(thisCategory);
237237
List<CategoryDescription> childCategories = categoryDescriptionRepositoryDao.findCategoriesByParentId(categoryId, language);
238238
productsByCategory.setChildCategories(childCategories);
@@ -242,7 +242,7 @@ public ProductsByCategory getProductsByCategoryAndManufacturer(
242242
@Override
243243
public ProductsByCategory getProductsByCategory(long categoryId,Language language){
244244
ProductsByCategory productsByCategory = new ProductsByCategory();
245-
Category category = categoryRepository.findOne(categoryId);
245+
Category category = categoryRepository.getOne(categoryId);
246246
List<SpecialProduct> products = new ArrayList<SpecialProduct>();
247247
List<ProductDescription> productDescriptions=productDescriptionRepositoryDao.findByCategory(category, language);
248248
for(ProductDescription productDescription:productDescriptions){
@@ -263,7 +263,7 @@ public ProductsByCategory getProductsByCategory(long categoryId,Language languag
263263
CategoryDescriptionId categoryDescriptionId = new CategoryDescriptionId();
264264
categoryDescriptionId.setLanguage(language);
265265
categoryDescriptionId.setCategory(category);
266-
CategoryDescription thisCategory = categoryDescriptionRepository.findOne(categoryDescriptionId);
266+
CategoryDescription thisCategory = categoryDescriptionRepository.getOne(categoryDescriptionId);
267267
productsByCategory.setThisCategory(thisCategory);
268268
List<CategoryDescription> childCategories = categoryDescriptionRepositoryDao.findCategoriesByParentId(categoryId, language);
269269
productsByCategory.setChildCategories(childCategories);

src/main/java/org/woehlke/greenshop/oodm/catalog/service/LanguageServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ public List<Language> findAllLanguages() {
3131

3232
@Override
3333
public Language findLanguageById(long languageId) {
34-
return languageRepository.findOne(languageId);
34+
return languageRepository.getOne(languageId);
3535
}
3636
}

src/main/java/org/woehlke/greenshop/oodm/catalog/service/ManufacturerServiceImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ public List<Manufacturer> getAllManufacturers() {
3939

4040
@Override
4141
public Manufacturer getManufacturerById(long manufacturerId) {
42-
return manufacturerRepository.findOne(manufacturerId);
42+
return manufacturerRepository.getOne(manufacturerId);
4343
}
4444

4545
//TODO: doppelte entfernen
4646
@Override
4747
public Manufacturers findManufacturers() {
48-
Sort sort = new Sort(Sort.Direction.ASC,"name");
48+
Sort sort = Sort.by(Sort.Direction.ASC,"name");
4949
List<Manufacturer> manufacturers = manufacturerRepository.findAll(sort);
5050
Manufacturers m = new Manufacturers();
5151
m.setManufacturers(manufacturers);
@@ -55,16 +55,16 @@ public Manufacturers findManufacturers() {
5555
//TODO: doppelte entfernen
5656
@Override
5757
public Manufacturer findManufacturerById(Long manufacturerId) {
58-
return manufacturerRepository.findOne(manufacturerId);
58+
return manufacturerRepository.getOne(manufacturerId);
5959
}
6060

6161
@Override
6262
public ManufacturerInfo findManufacturerInfo(long manufacturerId, Language language) {
63-
Manufacturer manufacturer = manufacturerRepository.findOne(manufacturerId);
63+
Manufacturer manufacturer = manufacturerRepository.getOne(manufacturerId);
6464
ManufacturerInfoId manufacturerInfoId = new ManufacturerInfoId();
6565
manufacturerInfoId.setLanguage(language);
6666
manufacturerInfoId.setManufacturer(manufacturer);
67-
return manufacturerInfoRepository.findOne(manufacturerInfoId);
67+
return manufacturerInfoRepository.getOne(manufacturerInfoId);
6868
}
6969

7070
@Override

src/main/java/org/woehlke/greenshop/oodm/catalog/service/ProductServiceImpl.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public int countProductsOfThisManufacturer(Manufacturer thisManufacturer) {
5353

5454
@Override
5555
public List<ProductDescription> findProductsViewed(Language language) {
56-
Sort sort = new Sort(Sort.Direction.DESC,"viewed");
56+
Sort sort = Sort.by(Sort.Direction.DESC,"viewed");
5757
return productDescriptionRepository.findAll(sort);
5858
}
5959

@@ -65,7 +65,7 @@ public List<ProductDescription> findProductsByCategoryId(long categoryId, Langua
6565
ProductDescriptionId id = new ProductDescriptionId();
6666
id.setProduct(product);
6767
id.setLanguage(language);
68-
ProductDescription productDescription = productDescriptionRepository.findOne(id);
68+
ProductDescription productDescription = productDescriptionRepository.getOne(id);
6969
productsByCategoryId.add(productDescription);
7070
}
7171
return productsByCategoryId;
@@ -74,15 +74,15 @@ public List<ProductDescription> findProductsByCategoryId(long categoryId, Langua
7474
@Override
7575
@Transactional(readOnly=false,propagation=Propagation.REQUIRES_NEW)
7676
public void setProductActive(long productId) {
77-
Product product = productRepository.findOne(productId);
77+
Product product = productRepository.getOne(productId);
7878
product.setStatus(true);
7979
productRepository.save(product);
8080
}
8181

8282
@Override
8383
@Transactional(readOnly=false,propagation=Propagation.REQUIRES_NEW)
8484
public void setProductInactive(long productId) {
85-
Product product = productRepository.findOne(productId);
85+
Product product = productRepository.getOne(productId);
8686
product.setStatus(false);
8787
productRepository.save(product);
8888
}
@@ -154,7 +154,7 @@ public ProductsByManufacturer findProductsByManufacturer(
154154
CategoryDescriptionId id = new CategoryDescriptionId();
155155
id.setCategory(category);
156156
id.setLanguage(language);
157-
CategoryDescription cd = categoryDescriptionRepository.findOne(id);
157+
CategoryDescription cd = categoryDescriptionRepository.getOne(id);
158158
categoriesOfProducts.add(cd);
159159
}
160160
productsByManufacturer.setCategoriesOfProducts(categoriesOfProducts);
@@ -164,7 +164,7 @@ public ProductsByManufacturer findProductsByManufacturer(
164164
@Override
165165
public ProductsByManufacturer findProductsByManufacturerAndCategory(
166166
Manufacturer manufacturer, long categoryId, Language language) {
167-
Category thisCategory=categoryRepository.findOne(categoryId);
167+
Category thisCategory=categoryRepository.getOne(categoryId);
168168
List<ProductDescription> products = productDescriptionRepositoryDao.findByCategoryAndManufacturer(thisCategory,manufacturer,language);
169169
ProductsByManufacturer productsByManufacturer = new ProductsByManufacturer();
170170
productsByManufacturer.setProducts(products);
@@ -182,7 +182,7 @@ public ProductsByManufacturer findProductsByManufacturerAndCategory(
182182
CategoryDescriptionId id = new CategoryDescriptionId();
183183
id.setCategory(category);
184184
id.setLanguage(language);
185-
CategoryDescription cd = categoryDescriptionRepository.findOne(id);
185+
CategoryDescription cd = categoryDescriptionRepository.getOne(id);
186186
categoriesOfProducts.add(cd);
187187
}
188188
productsByManufacturer.setCategoriesOfProducts(categoriesOfProducts);

0 commit comments

Comments
 (0)