Skip to content
Snippets Groups Projects
Commit 074a787a authored by Marek Skácelík's avatar Marek Skácelík
Browse files

Merge branch 'minor-fixes' into 'milestone-1'

Removed bunch of superflous annotations

See merge request !22
parents 2a706c6d 97ac00b2
No related branches found
No related tags found
2 merge requests!25Milestone 1,!22Removed bunch of superflous annotations
Pipeline #
......@@ -2,7 +2,6 @@ package cz.muni.fi.pa165.core.common;
import cz.muni.fi.pa165.model.dto.common.DomainObjectDto;
import cz.muni.fi.pa165.model.dto.common.Result;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.data.domain.Pageable;
import java.util.List;
......@@ -16,7 +15,6 @@ import java.util.List;
* @param <C> the DTO type representing a create operation for the entity
* @param <U> the DTO type representing an update operation for the entity
*/
@Transactional
public abstract class DomainFacade<E extends DomainObject,
T extends DomainObjectDto,
C extends DomainObjectDto,
......@@ -49,7 +47,6 @@ public abstract class DomainFacade<E extends DomainObject,
* @param id the ID of the entity to find
* @return the DTO representation of the found entity
*/
@Transactional(readOnly = true)
public T findById(String id) {
return mapper.toDto(service.findById(id));
}
......@@ -60,7 +57,6 @@ public abstract class DomainFacade<E extends DomainObject,
* @param pageable the pagination information
* @return a list of DTO representations of the found entities
*/
@Transactional(readOnly = true)
public List<T> findAllPageable(Pageable pageable) {
return mapper.toDtoList((List<E>) service.findAllPageable(pageable));
}
......@@ -71,7 +67,6 @@ public abstract class DomainFacade<E extends DomainObject,
* @param page the page number to retrieve
* @return a {@code Result} object containing pagination and entity information
*/
@Transactional(readOnly = true)
public Result<T> findAll(int page) {
return mapper.toResult(service.findAllPageableInt(page));
}
......@@ -82,7 +77,6 @@ public abstract class DomainFacade<E extends DomainObject,
*
* @return a list of DTO representations of the found entities
*/
@Transactional(readOnly = true)
public List<T> findAll() {
return mapper.toDtoList(service.findAll());
}
......@@ -93,7 +87,6 @@ public abstract class DomainFacade<E extends DomainObject,
* @param createDto the DTO representation of the create operation for the entity
* @return the DTO representation of the created entity
*/
@Transactional
public T create(C createDto) {
return mapper.toDto(service.create(mapper.fromCreateDto(createDto)));
}
......@@ -105,7 +98,6 @@ public abstract class DomainFacade<E extends DomainObject,
* @param id ID of the entity to be updated.
* @return DTO representing the updated entity.
*/
@Transactional
public T updateById(U updateDto, String id) {
return mapper.toDto(service.update(mapper.fromUpdateDto(updateDto), id));
}
......@@ -116,7 +108,6 @@ public abstract class DomainFacade<E extends DomainObject,
* @param id ID of the entity to be deleted.
* @return DTO representing the deleted entity.
*/
@Transactional
public T deleteById(String id) {
return mapper.toDto(service.deleteById(id));
}
......
......@@ -6,11 +6,9 @@ import cz.muni.fi.pa165.model.dto.company.CompanyDto;
import cz.muni.fi.pa165.model.dto.company.CompanyUpdateDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@Component
@Transactional
public class CompanyFacade extends DomainFacade<Company, CompanyDto, CompanyCreateDto, CompanyUpdateDto> {
private final CompanyService companyService; // For the "CompanyService" specific methods
......
......@@ -6,12 +6,8 @@ import cz.muni.fi.pa165.model.dto.device.DeviceDto;
import cz.muni.fi.pa165.model.dto.device.DeviceUpdateDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Component
@Transactional
public class DeviceFacade extends DomainFacade<Device, DeviceDto, DeviceCreateDto, DeviceUpdateDto> {
private final DeviceService deviceService; // For the "DeviceService" specific methods
......
......@@ -6,11 +6,9 @@ import cz.muni.fi.pa165.model.dto.house.HouseDto;
import cz.muni.fi.pa165.model.dto.house.HouseUpdateDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@Component
@Transactional
public class HouseFacade extends DomainFacade<House, HouseDto, HouseCreateDto, HouseUpdateDto> {
private final HouseService houseService; // For the "HouseService" specific methods
......
......@@ -6,10 +6,8 @@ import cz.muni.fi.pa165.model.dto.manufacturer.ManufacturerDto;
import cz.muni.fi.pa165.model.dto.manufacturer.ManufacturerUpdateDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@Component
@Transactional
public class ManufacturerFacade extends DomainFacade<Manufacturer,
ManufacturerDto,
ManufacturerCreateDto,
......
......@@ -6,10 +6,8 @@ import cz.muni.fi.pa165.model.dto.metrics.MetricsDto;
import cz.muni.fi.pa165.model.dto.metrics.MetricsUpdateDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@Component
@Transactional
public class MetricsFacade extends DomainFacade<Metrics,
MetricsDto,
MetricsCreateDto,
......
......@@ -6,10 +6,8 @@ import cz.muni.fi.pa165.model.dto.smartDevice.SmartMeterDto;
import cz.muni.fi.pa165.model.dto.smartDevice.SmartMeterUpdateDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@Component
@Transactional
public class SmartMeterFacade extends DomainFacade<SmartMeter,
SmartMeterDto,
SmartMeterCreateDto,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment