Class AttributeServiceImpl
- java.lang.Object
-
- co.mastermindcms.modules.services.AttributeServiceImpl
-
- All Implemented Interfaces:
AttributeService
@Service public class AttributeServiceImpl extends java.lang.Object implements AttributeService
-
-
Field Summary
Fields Modifier and Type Field Description private AttributeRepository
attributeRepository
private AttributeValueRepository
attributeValueRepository
private CommonProperties
commonProperties
private static com.fasterxml.jackson.databind.ObjectMapper
mapper
private MeasurementRepository
measurementRepository
private OptionRepository
optionRepository
private ProductRepository
productRepository
private SequenceGeneratorService
sequenceGenerator
private SKURepository
skuRepository
private MongoStorageService
storageService
private TranslationService
translationService
private TranslationsRepository
translationsRepository
-
Constructor Summary
Constructors Constructor Description AttributeServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Attribute
addAttributeToProduct(java.lang.String productId, java.lang.String attributeId)
This method does a relationship between entities.Attribute
addAttributeToProduct(java.lang.String productId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> attrAsMap)
This method does a relationship between entities.Attribute
addAttributeToSKU(java.lang.String skuId, java.lang.String attributeId)
This method does a relationship between entities.Attribute
addAttributeToSKU(java.lang.String skuId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> attrAsMap)
This method does a relationship between entities.private void
addRelations(Attribute aUI)
private void
addRelationsForMeasurement(Measurement mUI)
private void
addRelationsForOption(Option oUI)
java.util.Optional<Attribute>
createAttribute(Attribute attribute)
This method creates a database entity.java.util.Optional<Attribute>
createAttribute(java.util.LinkedHashMap<java.lang.String,java.lang.Object> attrAsMap)
This method creates a database entity.java.util.Optional<Measurement>
createMeasurement(Measurement measurement)
This method creates a database entity.java.util.Optional<Measurement>
createMeasurement(java.util.LinkedHashMap<java.lang.String,java.lang.Object> measureAsMap)
This method creates a database entity.java.util.Optional<Option>
createOption(Option option)
This method creates a database entity.java.util.Optional<Option>
createOption(java.util.LinkedHashMap<java.lang.String,java.lang.Object> optionAsMap)
This method creates a database entity.java.util.List<Attribute>
findAttributes()
This method returns data as list.java.util.List<Measurement>
findMeasurements()
This method returns data as list.java.util.List<Option>
findOptions()
This method returns data as list.java.lang.String
getAttributeValue(java.lang.String attributeValueId)
This method returns a value as text.MeasurementRepository
getMeasurementRepository()
java.lang.String
getMeasurementValueFromAttribute(java.lang.String attrId)
This method returns a value as text.java.util.List<Option>
getOptionsFromAttribute(java.lang.String attrId)
This method does request to retrieve data as list.OptionRepository
getOptionsRepository()
java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>>
getPaginationFilter(java.lang.String requestJson)
This method does calculation for a pages based on the request.java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>>
getPaginationMeasurements(java.lang.String requestJson)
This method does calculation for a pages based on the request.java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>>
getPaginationOptions(java.lang.String requestJson)
This method does calculation for a pages based on the request.AttributeRepository
getRepository()
AttributeDTO
mapAttributeToDto(Attribute attr, boolean optimal)
This method does map product entity to dto objectMeasurementDTO
mapMeasurementToDto(Measurement msr, boolean optimal)
This method does map product entity to dto objectOptionDTO
mapOptionToDto(Option opt, boolean optimal)
This method does map product entity to dto objectprivate void
prepareRelations(Attribute aUI)
private void
prepareRelationsForMeasurement(Measurement mUI)
private void
prepareRelationsForOption(Option oUI)
void
removeAttributeAndClean(java.lang.String attrId)
This method removes a database entity and clean all relationships from another entities.void
removeAttributeFromMeasurement(java.lang.String attrId)
This method removes relationship between database entities.void
removeAttributeFromOption(java.lang.String attrId, java.lang.String optionId)
This method removes relationship between database entities.void
removeAttributeFromOptions(java.lang.String attrId)
This method removes relationship between database entities.void
removeAttributeFromProduct(java.lang.String attrId, java.lang.String productId)
This method removes relationship between database entities.void
removeAttributeFromProducts(java.lang.String attrId)
This method removes relationship between database entities.void
removeAttributeFromSKU(java.lang.String attrId, java.lang.String skuId)
This method removes relationship between database entities.void
removeAttributeFromSKUs(java.lang.String attrId)
This method removes relationship between database entities.void
removeAttributeFromTranslation(java.lang.String attrId, java.lang.String tranId)
This method removes relationship between database entities.void
removeAttributeFromTranslations(java.lang.String attrId)
This method removes relationship between database entities.void
removeAttributesByIds(java.util.ArrayList<java.lang.String> attributeIds)
This method removes a list of database entities.void
removeAttributeValue(java.lang.String avId)
This method removes database entity.private void
removeAttributeValuesByAttribute(Attribute attribute)
void
removeAttributeValuesByAttributeId(java.lang.String attributeId)
This method removes all relationships between database entities.void
removeMeasurementAndClean(java.lang.String measureId)
This method removes a database entity and clean all relationships from another entities.void
removeMeasurementFromAttribute(java.lang.String measureId, java.lang.String attrId)
This method removes relationship between database entities.void
removeMeasurementFromAttributes(java.lang.String measureId)
This method removes relationship between database entities.void
removeMeasurementsByIds(java.util.ArrayList<java.lang.String> measurementsIds)
This method removes a list of database entities.void
removeOptionAndClean(java.lang.String optionId)
This method removes a database entity and clean all relationships from another entities.void
removeOptionFromAttribute(java.lang.String optionId, java.lang.String attrId)
This method removes relationship between database entities.void
removeOptionFromAttributes(java.lang.String optionId)
This method removes relationship between database entities.void
removeOptionFromTranslation(java.lang.String optionId, java.lang.String tranId)
This method removes relationship between database entities.void
removeOptionFromTranslations(java.lang.String optionId)
This method removes relationship between database entities.void
removeOptionsByIds(java.util.ArrayList<java.lang.String> optionsIds)
This method removes a list of database entities.private void
removeRelations(Attribute aUI, Attribute aDB)
private void
removeRelationsForMeasurement(Measurement mUI, Measurement mDB)
private void
removeRelationsForOption(Option oUI, Option oDB)
Attribute
saveAttribute(Attribute attribute)
This method saves a database entity.Attribute
saveAttribute(java.util.LinkedHashMap<java.lang.String,java.lang.Object> attrAsMap)
This method save an updates of database entity.Measurement
saveMeasurement(Measurement msr)
This method save an updates of database entity.Measurement
saveMeasurement(java.util.LinkedHashMap<java.lang.String,java.lang.Object> msrAsMap)
This method save an updates of database entity.Option
saveOption(Option option)
This method save an updates of database entity.Option
saveOption(java.util.LinkedHashMap<java.lang.String,java.lang.Object> optAsMap)
This method save an updates of database entity.java.util.LinkedHashSet<AttributeDTO>
searchAttributes(java.lang.String requestJson)
This method does search requests and returns data as list.java.util.List<Attribute>
searchAttributes(java.lang.String query, java.lang.String offset, java.lang.String limit)
Deprecated.org.springframework.data.domain.Page<Attribute>
searchAttributesPaged(java.lang.String requestJson)
This method does search requests and returns data as pages.java.util.LinkedHashSet<MeasurementDTO>
searchMeasurements(java.lang.String requestJson)
This method does search requests and returns data as list.java.util.List<Measurement>
searchMeasurements(java.lang.String query, java.lang.String offset, java.lang.String limit)
Deprecated.org.springframework.data.domain.Page<Measurement>
searchMeasurementsPaged(java.lang.String requestJson)
This method does search requests and returns data as pages.java.util.LinkedHashSet<OptionDTO>
searchOptions(java.lang.String requestJson)
This method does search requests and returns data as list.java.util.List<Option>
searchOptions(java.lang.String query, java.lang.String offset, java.lang.String limit)
Deprecated.org.springframework.data.domain.Page<Option>
searchOptionsPaged(java.lang.String requestJson)
This method does search requests and returns data as pages.
-
-
-
Field Detail
-
translationsRepository
@Autowired private TranslationsRepository translationsRepository
-
attributeRepository
@Autowired private AttributeRepository attributeRepository
-
attributeValueRepository
@Autowired private AttributeValueRepository attributeValueRepository
-
measurementRepository
@Autowired private MeasurementRepository measurementRepository
-
optionRepository
@Autowired private OptionRepository optionRepository
-
productRepository
@Autowired private ProductRepository productRepository
-
skuRepository
@Autowired private SKURepository skuRepository
-
sequenceGenerator
@Autowired private SequenceGeneratorService sequenceGenerator
-
storageService
@Autowired private MongoStorageService storageService
-
translationService
@Autowired private TranslationService translationService
-
commonProperties
@Autowired private CommonProperties commonProperties
-
mapper
private static final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Method Detail
-
getRepository
public AttributeRepository getRepository()
- Specified by:
getRepository
in interfaceAttributeService
-
getMeasurementRepository
public MeasurementRepository getMeasurementRepository()
- Specified by:
getMeasurementRepository
in interfaceAttributeService
-
getOptionsRepository
public OptionRepository getOptionsRepository()
- Specified by:
getOptionsRepository
in interfaceAttributeService
-
getPaginationFilter
public java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>> getPaginationFilter(java.lang.String requestJson)
Description copied from interface:AttributeService
This method does calculation for a pages based on the request.- Specified by:
getPaginationFilter
in interfaceAttributeService
- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- map-representation of data
-
searchAttributes
public java.util.LinkedHashSet<AttributeDTO> searchAttributes(java.lang.String requestJson)
Description copied from interface:AttributeService
This method does search requests and returns data as list.- Specified by:
searchAttributes
in interfaceAttributeService
- Parameters:
requestJson
- search request- Returns:
- data transport entities as list
-
searchAttributesPaged
public org.springframework.data.domain.Page<Attribute> searchAttributesPaged(java.lang.String requestJson)
Description copied from interface:AttributeService
This method does search requests and returns data as pages.- Specified by:
searchAttributesPaged
in interfaceAttributeService
- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- database entities separated to pages
-
getPaginationMeasurements
public java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>> getPaginationMeasurements(java.lang.String requestJson)
Description copied from interface:AttributeService
This method does calculation for a pages based on the request.- Specified by:
getPaginationMeasurements
in interfaceAttributeService
- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- map-representation of data
-
searchMeasurements
public java.util.LinkedHashSet<MeasurementDTO> searchMeasurements(java.lang.String requestJson)
Description copied from interface:AttributeService
This method does search requests and returns data as list.- Specified by:
searchMeasurements
in interfaceAttributeService
- Parameters:
requestJson
- search request- Returns:
- data transport entities as list
-
searchMeasurementsPaged
public org.springframework.data.domain.Page<Measurement> searchMeasurementsPaged(java.lang.String requestJson)
Description copied from interface:AttributeService
This method does search requests and returns data as pages.- Specified by:
searchMeasurementsPaged
in interfaceAttributeService
- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- database entities separated to pages
-
getPaginationOptions
public java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>> getPaginationOptions(java.lang.String requestJson)
Description copied from interface:AttributeService
This method does calculation for a pages based on the request.- Specified by:
getPaginationOptions
in interfaceAttributeService
- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- map-representation of data
-
searchOptions
public java.util.LinkedHashSet<OptionDTO> searchOptions(java.lang.String requestJson)
Description copied from interface:AttributeService
This method does search requests and returns data as list.- Specified by:
searchOptions
in interfaceAttributeService
- Parameters:
requestJson
- search request- Returns:
- data transport entities as list
-
searchOptionsPaged
public org.springframework.data.domain.Page<Option> searchOptionsPaged(java.lang.String requestJson)
Description copied from interface:AttributeService
This method does search requests and returns data as pages.- Specified by:
searchOptionsPaged
in interfaceAttributeService
- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- database entities separated to pages
-
searchAttributes
@Deprecated public java.util.List<Attribute> searchAttributes(java.lang.String query, java.lang.String offset, java.lang.String limit)
Deprecated.Description copied from interface:AttributeService
This method does search requests and returns data as list.- Specified by:
searchAttributes
in interfaceAttributeService
- Parameters:
query
- search queryoffset
- offset for returned itemslimit
- limit for returned items- Returns:
- database entities as list
-
findAttributes
public java.util.List<Attribute> findAttributes()
Description copied from interface:AttributeService
This method returns data as list.- Specified by:
findAttributes
in interfaceAttributeService
- Returns:
- database entities as list
-
searchMeasurements
@Deprecated public java.util.List<Measurement> searchMeasurements(java.lang.String query, java.lang.String offset, java.lang.String limit)
Deprecated.Description copied from interface:AttributeService
This method does search requests and returns data as list.- Specified by:
searchMeasurements
in interfaceAttributeService
- Parameters:
query
- search queryoffset
- offset for returned itemslimit
- limit for returned items- Returns:
- database entities as list
-
findMeasurements
public java.util.List<Measurement> findMeasurements()
Description copied from interface:AttributeService
This method returns data as list.- Specified by:
findMeasurements
in interfaceAttributeService
- Returns:
- database entities as list
-
searchOptions
@Deprecated public java.util.List<Option> searchOptions(java.lang.String query, java.lang.String offset, java.lang.String limit)
Deprecated.Description copied from interface:AttributeService
This method does search requests and returns data as list.- Specified by:
searchOptions
in interfaceAttributeService
- Parameters:
query
- search queryoffset
- offset for returned itemslimit
- limit for returned items- Returns:
- database entities as list
-
findOptions
public java.util.List<Option> findOptions()
Description copied from interface:AttributeService
This method returns data as list.- Specified by:
findOptions
in interfaceAttributeService
- Returns:
- database entities as list
-
getOptionsFromAttribute
public java.util.List<Option> getOptionsFromAttribute(java.lang.String attrId)
Description copied from interface:AttributeService
This method does request to retrieve data as list.- Specified by:
getOptionsFromAttribute
in interfaceAttributeService
- Parameters:
attrId
- this attribute id is used for return all related options- Returns:
- all related options
-
getMeasurementValueFromAttribute
public java.lang.String getMeasurementValueFromAttribute(java.lang.String attrId)
Description copied from interface:AttributeService
This method returns a value as text.- Specified by:
getMeasurementValueFromAttribute
in interfaceAttributeService
- Parameters:
attrId
- identification for database entity which will be retrieved- Returns:
- value as text
-
getAttributeValue
public java.lang.String getAttributeValue(java.lang.String attributeValueId)
Description copied from interface:AttributeService
This method returns a value as text.- Specified by:
getAttributeValue
in interfaceAttributeService
- Parameters:
attributeValueId
- identification for database entity which will be retrieved- Returns:
- value as text
-
createMeasurement
@Transactional public java.util.Optional<Measurement> createMeasurement(java.util.LinkedHashMap<java.lang.String,java.lang.Object> measureAsMap)
Description copied from interface:AttributeService
This method creates a database entity.- Specified by:
createMeasurement
in interfaceAttributeService
- Parameters:
measureAsMap
- map-representation of database entity- Returns:
- optional value to externally interaction
-
createOption
@Transactional public java.util.Optional<Option> createOption(java.util.LinkedHashMap<java.lang.String,java.lang.Object> optionAsMap)
Description copied from interface:AttributeService
This method creates a database entity.- Specified by:
createOption
in interfaceAttributeService
- Parameters:
optionAsMap
- map-representation of database entity- Returns:
- optional value to externally interaction
-
createAttribute
@Transactional public java.util.Optional<Attribute> createAttribute(java.util.LinkedHashMap<java.lang.String,java.lang.Object> attrAsMap)
Description copied from interface:AttributeService
This method creates a database entity.- Specified by:
createAttribute
in interfaceAttributeService
- Parameters:
attrAsMap
- map-representation of database entity- Returns:
- optional value to externally interaction
-
createMeasurement
public java.util.Optional<Measurement> createMeasurement(Measurement measurement)
Description copied from interface:AttributeService
This method creates a database entity.- Specified by:
createMeasurement
in interfaceAttributeService
- Parameters:
measurement
- database entity- Returns:
- optional value to externally interaction
-
createOption
public java.util.Optional<Option> createOption(Option option)
Description copied from interface:AttributeService
This method creates a database entity.- Specified by:
createOption
in interfaceAttributeService
- Parameters:
option
- database entity- Returns:
- optional value to externally interaction
-
createAttribute
public java.util.Optional<Attribute> createAttribute(Attribute attribute)
Description copied from interface:AttributeService
This method creates a database entity.- Specified by:
createAttribute
in interfaceAttributeService
- Parameters:
attribute
- database entity- Returns:
- optional value to externally interaction
-
addAttributeToProduct
@Transactional public Attribute addAttributeToProduct(java.lang.String productId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> attrAsMap)
Description copied from interface:AttributeService
This method does a relationship between entities.- Specified by:
addAttributeToProduct
in interfaceAttributeService
- Parameters:
productId
- identification for database entity which will be updatedattrAsMap
- map-representation of database entity- Returns:
- database entity
-
addAttributeToProduct
@Transactional public Attribute addAttributeToProduct(java.lang.String productId, java.lang.String attributeId)
Description copied from interface:AttributeService
This method does a relationship between entities.- Specified by:
addAttributeToProduct
in interfaceAttributeService
- Parameters:
productId
- identification for database entity which will be updatedattributeId
- attribute identifier- Returns:
- database entity
-
addAttributeToSKU
@Transactional public Attribute addAttributeToSKU(java.lang.String skuId, java.util.LinkedHashMap<java.lang.String,java.lang.Object> attrAsMap)
Description copied from interface:AttributeService
This method does a relationship between entities.- Specified by:
addAttributeToSKU
in interfaceAttributeService
- Parameters:
skuId
- identification for database entity which will be updatedattrAsMap
- map-representation of database entity- Returns:
- database entity
-
addAttributeToSKU
@Transactional public Attribute addAttributeToSKU(java.lang.String skuId, java.lang.String attributeId)
Description copied from interface:AttributeService
This method does a relationship between entities.- Specified by:
addAttributeToSKU
in interfaceAttributeService
- Parameters:
skuId
- identification for database entity which will be updatedattributeId
- attribute identifier- Returns:
- database entity
-
saveAttribute
@Transactional public Attribute saveAttribute(java.util.LinkedHashMap<java.lang.String,java.lang.Object> attrAsMap)
Description copied from interface:AttributeService
This method save an updates of database entity.- Specified by:
saveAttribute
in interfaceAttributeService
- Parameters:
attrAsMap
- map-representation of database entity- Returns:
- saved instance of database entity
-
saveAttribute
public Attribute saveAttribute(Attribute attribute)
Description copied from interface:AttributeService
This method saves a database entity.- Specified by:
saveAttribute
in interfaceAttributeService
- Parameters:
attribute
- database entity- Returns:
- saved instance of database entity
-
saveMeasurement
public Measurement saveMeasurement(java.util.LinkedHashMap<java.lang.String,java.lang.Object> msrAsMap)
Description copied from interface:AttributeService
This method save an updates of database entity.- Specified by:
saveMeasurement
in interfaceAttributeService
- Parameters:
msrAsMap
- map-representation of database entity- Returns:
- saved instance of database entity
-
saveMeasurement
public Measurement saveMeasurement(Measurement msr)
Description copied from interface:AttributeService
This method save an updates of database entity.- Specified by:
saveMeasurement
in interfaceAttributeService
- Parameters:
msr
- database entity- Returns:
- saved instance of database entity
-
saveOption
public Option saveOption(java.util.LinkedHashMap<java.lang.String,java.lang.Object> optAsMap)
Description copied from interface:AttributeService
This method save an updates of database entity.- Specified by:
saveOption
in interfaceAttributeService
- Parameters:
optAsMap
- map-representation of database entity- Returns:
- optional value to externally interaction
-
saveOption
public Option saveOption(Option option)
Description copied from interface:AttributeService
This method save an updates of database entity.- Specified by:
saveOption
in interfaceAttributeService
- Parameters:
option
- database entity- Returns:
- value to externally interaction
-
prepareRelations
private void prepareRelations(Attribute aUI)
-
addRelations
private void addRelations(Attribute aUI)
-
prepareRelationsForMeasurement
private void prepareRelationsForMeasurement(Measurement mUI)
-
removeRelationsForMeasurement
private void removeRelationsForMeasurement(Measurement mUI, Measurement mDB)
-
addRelationsForMeasurement
private void addRelationsForMeasurement(Measurement mUI)
-
prepareRelationsForOption
private void prepareRelationsForOption(Option oUI)
-
addRelationsForOption
private void addRelationsForOption(Option oUI)
-
removeAttributeFromProduct
@Transactional public void removeAttributeFromProduct(java.lang.String attrId, java.lang.String productId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeAttributeFromProduct
in interfaceAttributeService
- Parameters:
attrId
- identification for database entity which will be removedproductId
- identification for database entity which will be updated
-
removeAttributeFromProducts
@Transactional public void removeAttributeFromProducts(java.lang.String attrId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeAttributeFromProducts
in interfaceAttributeService
- Parameters:
attrId
- identification for database entity which will be removed
-
removeAttributeFromSKU
@Transactional public void removeAttributeFromSKU(java.lang.String attrId, java.lang.String skuId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeAttributeFromSKU
in interfaceAttributeService
- Parameters:
attrId
- identification for database entity which will be removedskuId
- identification for database entity which will be updated
-
removeAttributeFromSKUs
@Transactional public void removeAttributeFromSKUs(java.lang.String attrId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeAttributeFromSKUs
in interfaceAttributeService
- Parameters:
attrId
- identification for database entity which will be removed
-
removeAttributeValue
public void removeAttributeValue(java.lang.String avId)
Description copied from interface:AttributeService
This method removes database entity.- Specified by:
removeAttributeValue
in interfaceAttributeService
- Parameters:
avId
- identification for database entity which will be removed
-
removeAttributeFromTranslation
@Transactional public void removeAttributeFromTranslation(java.lang.String attrId, java.lang.String tranId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeAttributeFromTranslation
in interfaceAttributeService
- Parameters:
attrId
- identification for database entity which will be removedtranId
- identification for database entity which will be updated
-
removeAttributeFromTranslations
@Transactional public void removeAttributeFromTranslations(java.lang.String attrId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeAttributeFromTranslations
in interfaceAttributeService
- Parameters:
attrId
- identification for database entity which will be removed
-
removeAttributeFromOption
@Transactional public void removeAttributeFromOption(java.lang.String attrId, java.lang.String optionId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeAttributeFromOption
in interfaceAttributeService
- Parameters:
attrId
- identification for database entity which will be removedoptionId
- identification for database entity which will be updated
-
removeAttributeFromOptions
@Transactional public void removeAttributeFromOptions(java.lang.String attrId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeAttributeFromOptions
in interfaceAttributeService
- Parameters:
attrId
- identification for database entity which will be removed
-
removeAttributeFromMeasurement
@Transactional public void removeAttributeFromMeasurement(java.lang.String attrId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeAttributeFromMeasurement
in interfaceAttributeService
- Parameters:
attrId
- identification for database entity which will be removed
-
removeAttributeAndClean
@Transactional public void removeAttributeAndClean(java.lang.String attrId)
Description copied from interface:AttributeService
This method removes a database entity and clean all relationships from another entities.- Specified by:
removeAttributeAndClean
in interfaceAttributeService
- Parameters:
attrId
- identification for database entity which will be removed
-
removeMeasurementFromAttribute
@Transactional public void removeMeasurementFromAttribute(java.lang.String measureId, java.lang.String attrId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeMeasurementFromAttribute
in interfaceAttributeService
- Parameters:
measureId
- identification for database entity which will be removedattrId
- identification for database entity which will be updated
-
removeMeasurementFromAttributes
public void removeMeasurementFromAttributes(java.lang.String measureId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeMeasurementFromAttributes
in interfaceAttributeService
- Parameters:
measureId
- identification for database entity which will be removed
-
removeMeasurementAndClean
@Transactional public void removeMeasurementAndClean(java.lang.String measureId)
Description copied from interface:AttributeService
This method removes a database entity and clean all relationships from another entities.- Specified by:
removeMeasurementAndClean
in interfaceAttributeService
- Parameters:
measureId
- identification for database entity which will be removed
-
removeOptionFromAttribute
@Transactional public void removeOptionFromAttribute(java.lang.String optionId, java.lang.String attrId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeOptionFromAttribute
in interfaceAttributeService
- Parameters:
optionId
- identification for database entity which will be removedattrId
- identification for database entity which will be updated
-
removeOptionFromAttributes
@Transactional public void removeOptionFromAttributes(java.lang.String optionId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeOptionFromAttributes
in interfaceAttributeService
- Parameters:
optionId
- identification for database entity which will be removed
-
removeOptionFromTranslation
@Transactional public void removeOptionFromTranslation(java.lang.String optionId, java.lang.String tranId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeOptionFromTranslation
in interfaceAttributeService
- Parameters:
optionId
- identification for database entity which will be removedtranId
- identification for database entity which will be updated
-
removeOptionFromTranslations
@Transactional public void removeOptionFromTranslations(java.lang.String optionId)
Description copied from interface:AttributeService
This method removes relationship between database entities.- Specified by:
removeOptionFromTranslations
in interfaceAttributeService
- Parameters:
optionId
- identification for database entity which will be removed
-
removeOptionAndClean
@Transactional public void removeOptionAndClean(java.lang.String optionId)
Description copied from interface:AttributeService
This method removes a database entity and clean all relationships from another entities.- Specified by:
removeOptionAndClean
in interfaceAttributeService
- Parameters:
optionId
- identification for database entity which will be removed
-
removeAttributeValuesByAttributeId
public void removeAttributeValuesByAttributeId(java.lang.String attributeId)
Description copied from interface:AttributeService
This method removes all relationships between database entities.- Specified by:
removeAttributeValuesByAttributeId
in interfaceAttributeService
- Parameters:
attributeId
- identification for database entity which will be updated
-
removeAttributesByIds
@Transactional public void removeAttributesByIds(java.util.ArrayList<java.lang.String> attributeIds)
Description copied from interface:AttributeService
This method removes a list of database entities.- Specified by:
removeAttributesByIds
in interfaceAttributeService
- Parameters:
attributeIds
- the list of database entities which will be removed
-
removeMeasurementsByIds
@Transactional public void removeMeasurementsByIds(java.util.ArrayList<java.lang.String> measurementsIds)
Description copied from interface:AttributeService
This method removes a list of database entities.- Specified by:
removeMeasurementsByIds
in interfaceAttributeService
- Parameters:
measurementsIds
- the list of database entities which will be removed
-
removeOptionsByIds
@Transactional public void removeOptionsByIds(java.util.ArrayList<java.lang.String> optionsIds)
Description copied from interface:AttributeService
This method removes a list of database entities.- Specified by:
removeOptionsByIds
in interfaceAttributeService
- Parameters:
optionsIds
- the list of database entities which will be removed
-
mapAttributeToDto
public AttributeDTO mapAttributeToDto(Attribute attr, boolean optimal)
Description copied from interface:AttributeService
This method does map product entity to dto object- Specified by:
mapAttributeToDto
in interfaceAttributeService
- Parameters:
attr
- database entity which be used to map to dtooptimal
- this pointer optimises the data transfer object- Returns:
- data transport object
-
mapOptionToDto
public OptionDTO mapOptionToDto(Option opt, boolean optimal)
Description copied from interface:AttributeService
This method does map product entity to dto object- Specified by:
mapOptionToDto
in interfaceAttributeService
- Parameters:
opt
- database entity which be used to map to dtooptimal
- this pointer optimises the data transfer object- Returns:
- data transport object
-
mapMeasurementToDto
public MeasurementDTO mapMeasurementToDto(Measurement msr, boolean optimal)
Description copied from interface:AttributeService
This method does map product entity to dto object- Specified by:
mapMeasurementToDto
in interfaceAttributeService
- Parameters:
msr
- database entity which be used to map to dtooptimal
- this pointer optimises the data transfer object- Returns:
- data transport object
-
removeAttributeValuesByAttribute
private void removeAttributeValuesByAttribute(Attribute attribute)
-
-